browserify / browserify/browserify-aes

"value" argument is out of bounds

Open
#62 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
62
Forks
27
PR merge metrics
No merged PRs in 30d

Description

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

`"value" argument is out of bounds`

```js
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`](https://github.com/crypto-browserify/browserify-aes/blob/e107f575a4c5df8ad08689db70938ed1b694ca62/ghash.js#L112) 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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.