The AES-CTR counter length from algorithm.length was read as a signed
integer and only rejected when it was zero or above 128, so a negative
value passed the check. It was then handed to njs_bn_counter128(),
whose bits parameter is njs_uint_t (uintptr_t on 64-bit builds), so a
negative length turned into a very large unsigned count. The derived
byte count then drove a memcpy() into a 16-byte stack buffer with an
attacker-influenced size, overflowing it and reading past the counter
block. The value reaches here directly from crypto.subtle.encrypt()
and decrypt() calls on both engines.
Reject any length below 1 as well, matching the 1 to 128 range the
error message already states and the WebCrypto specification requires.