browserify-aes icon indicating copy to clipboard operation
browserify-aes copied to clipboard

"value" argument is out of bounds

Open alexpapworth opened this issue 3 years ago • 0 comments

Hiya, been seeing this infrequent error in production (10 times in the last 3 months)

"value" argument is out of bounds

function checkInt (buf, value, offset, ext, max, min) {
  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
}

Looks like it's coming from the update function.

/static/node_modules/buffer/index.js:1259:40:in `unknown'
/static/node_modules/buffer/index.js:1369:17:in `checkInt'
/static/node_modules/browserify-aes/aes.js:198:6:in `writeUInt32BE'
/static/node_modules/browserify-aes/modes/cbc.js:6:28:in `encryptBlock'
/static/node_modules/browserify-aes/encrypter.js:29:23:in `encrypt'
/static/node_modules/cipher-base/index.js:28:21:in `_update'
/static/js/components/home/Encrypt.js:25:24:in `update' <---- 👋
/static/js/components/home/Encrypt.js:48:41:in `encryptParams'
/static/node_modules/react-dom/cjs/react-dom.production.min.js:187:187:in `render'
/static/node_modules/react-dom/cjs/react-dom.production.min.js:186:172:in `qi' 

Is this something we can get the package to handle, or is it to do with the data I'm feeding in?

alexpapworth avatar Oct 21 '21 09:10 alexpapworth