Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

"value" argument is out of bounds

Open
#62 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
cryptography

Research direction

Start with the update function linked in ghash.js at line 112, then trace the reported call through browserify-aes/aes.js and modes/cbc.js to buffer's checkInt. Reproduce the error using the data passed to Encrypt.js, and determine whether the package or the input causes the out-of-bounds value; done means the cause and handling are documented or verified.

Written by the indexing model from the issue text.

Description

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?

Dominant language
JavaScript
Stars
62
Forks
28
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from browserify/browserify-aes

All issues in browserify/browserify-aes

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.