News
Attacker-controlled binary-parser definitions can run JavaScript.
binary-parser before 2.3.1 copies some definition strings straight into generated JavaScript. An attacker who controls that definition can run code in the Node.js process when the parser is compiled.

Impact
- What was impacted
- The binary-parser library, versions before 2.3.1. CVE-2026-134814 is a code-injection flaw. The report lists two scores, 9.2 and 8.1. String options were placed into generated JavaScript without a sufficient check, through Context.generateOption(). The options named are length, lengthInBytes, key, tag, offset, and the alias passed to namely(). A crafted value in one of those runs in the Node.js process when the parser is compiled. Maintainer Keichi Takahashi's November 11, 2026 advisory says a trusted parser definition that only parses untrusted binary data is outside this flaw. The report also describes CVE-2026-134814 as an incomplete fix for CVE-2026-1245, scored 6.5, a code-injection bug fixed in January 2026 after weak checks on field names and encoding parameters.
- Who was impacted
- Teams that run Node.js code which builds a binary-parser definition from input they do not fully control: a customer, a plugin, an uploaded config, or any other outside party. An application that ships its own definition and only feeds it untrusted bytes is outside this flaw, according to the maintainer.
- What you need to do
- Update binary-parser to 2.3.1 or later. After that release, those options are accepted only as identifier paths, such as foo or $parent.len. An expression such as len - 1 is rejected. The maintainer says to use a function instead of that expression. Find every place the application sets length, lengthInBytes, key, tag, offset, or namely() from outside input, and stop passing that input through until the package is updated. Do not send a crafted definition to test the bug.
A flaw in the binary-parser library lets an attacker who controls the parser definition run JavaScript inside the Node.js process. The identifier is CVE-2026-134814. It affects versions before 2.3.1. The report lists two severity scores, 9.2 and 8.1. The bug is code injection: some string options were copied into the JavaScript the library generates, without a strong enough check. That happens in Context.generateOption(). The code runs when the parser is compiled.
The options named in the vulnerability description are length, lengthInBytes, key, tag, offset, and the alias passed to namely(). A crafted value in one of those fields is enough. Maintainer Keichi Takahashi published an advisory on November 11, 2026. He wrote that parsing untrusted binary data with a trusted parser definition is not affected. The fix checks those options as identifier paths, for example foo or $parent.len. An expression such as len - 1 is now rejected. His advice for that case is to use a function instead.
The same report treats CVE-2026-134814 as an incomplete fix for CVE-2026-1245, scored 6.5. That earlier bug was fixed in January 2026 and came from insufficient checks on field names and encoding parameters. Upwind Security described the current flaw as a way for someone who controls parser definitions to inject and run JavaScript in the host Node.js process when the parser is compiled. The published advice is to move to the fixed library. The report does not name attacks in the wild, and it does not include a proof of concept.
For your AI agent
Agent instructions — copy paste to Claude
You are helping me respond to CVE-2026-134814, a code-injection flaw in the binary-parser library before version 2.3.1. An attacker who controls a parser definition can run JavaScript in the Node.js process when the parser is compiled. Do not write or send a parser definition, a payload, or a proof of concept. Ask before upgrading a dependency, changing a lockfile, or editing application code. Facts from the report: - CVE-2026-134814 affects binary-parser versions before 2.3.1. The report lists two scores, 9.2 and 8.1. Do not collapse those into one score. - It is code injection. String-typed options were passed, unvalidated, through Context.generateOption() and inserted into generated JavaScript. The options named are length, lengthInBytes, key, tag, offset, and the alias passed to namely(). Crafted values execute when the parser is compiled. - Maintainer Keichi Takahashi's advisory is dated November 11, 2026. He said parsing untrusted binary data with a trusted parser definition is not affected. - In the fixed release, those options are validated as identifier paths, for example foo or $parent.len. Expressions such as len - 1 are rejected. He said to use a function instead. - The report describes this as an incomplete fix for CVE-2026-1245, scored 6.5, fixed in January 2026, which came from insufficient validation of field names and encoding parameters. - Upwind Security said an attacker who controls parser definitions can inject and execute JavaScript in the host Node.js process when the parser is compiled. - The report does not describe attacks in the wild and does not include exploit code. Do not invent a victim or a package version newer than 2.3.1. Context: - What was impacted: binary-parser before 2.3.1, when the parser definition is attacker-controlled. - Who should care: Node.js applications that build a parser definition from outside input. - What to do: update to 2.3.1 or later, and replace outside strings in the named options with identifier paths or functions. Do this in order. Ask before changing a dependency or application code. Prefer read-only inventory first. Do not write or run an exploit or a proof of concept. 1. Inventory - Find dependency files that name binary-parser and record the installed version. If you cannot read them, say so and stop. - Versions before 2.3.1 are affected. If the version is missing, say unknown. Do not mark an unknown copy as safe. - Search application code for length, lengthInBytes, key, tag, offset, and namely( used with binary-parser. Note any value that comes from a request, a file a user can edit, a plugin, or another outside source. - If every definition is written by the application and only the bytes being parsed are untrusted, say the maintainer places that case outside this flaw. Still record the installed version. 2. Contain - If a definition is built from outside input and the installed version is before 2.3.1, say which service that is. Propose stopping that path from accepting a new definition until the library is updated. Ask before changing the service. - Do not send a crafted definition to the application. 3. Remediate - Plan an update to binary-parser 2.3.1 or later. Ask before changing the lockfile or deploying. - Where code passed an expression such as len - 1 in one of the named options, plan to replace it with a function, which is what the maintainer said to do. Ask before editing that code. 4. Verify - After an update I asked you to make, read the installed version again and confirm it is 2.3.1 or later. - If I did not ask you to change anything, report the inventory only. 5. Report back - Which projects include binary-parser, which versions you could see, which call sites take outside input, what you changed, and that the report does not describe attacks in the wild. Do not invent CVEs, victims, or a version number above 2.3.1. If a check needs access I have not given you, say what you need and stop.