Threat Intelligence

Critical binary-parser Flaw Lets Crafted Parser Definitions Run JavaScript in Node.js

The Hacker News · 23 Nov 2026
Key Takeaway If your business builds or relies on Node.js software that uses binary-parser, update it to version 2.3.1 or later and make sure parser definitions never come from untrusted input.

A critical vulnerability has been disclosed in binary-parser, a popular library for reading binary data in Node.js applications. Tracked as CVE-2026-134814, the flaw carries CVSS scores of 9.2 and 8.1 and affects all versions before 2.3.1. It is a code injection issue that could let an attacker execute arbitrary code.

According to the NIST National Vulnerability Database, the problem lies in how the library handles certain string options. Values such as length, lengthInBytes, key, tag, offset, or namely() alias are passed unvalidated through Context.generateOption(). An attacker who can supply crafted values for these options can run arbitrary JavaScript in the Node.js process when the parser is compiled.

The maintainer, Keichi Takahashi, explained in an advisory dated 11 November 2026 that some user-controlled string options were inserted directly into the generated JavaScript code without adequate validation. Importantly, he noted that parsing untrusted binary data with a trusted parser definition is not affected. The risk applies where the parser definition itself comes from an untrusted source.

The fix now validates these options as identifier paths, such as foo or $parent.len. Expressions like 'len - 1' are rejected, and developers are told to use a function instead. This may require small code changes for some projects.

The flaw can also be seen as an incomplete fix for CVE-2026-1245, a code injection bug rated 6.5 that was patched in January 2026 and stemmed from weak validation of field names and encoding parameters. Upwind Security highlighted the new issue publicly, and users are advised to update to the latest version of the library.

Why it matters

Teams may have assumed the January 2026 fix for CVE-2026-1245 closed this class of bug, but the same weakness survived in other options, so a past patch is not proof of safety. Exposure depends on a design choice: applications that let users, tenants, or external files define parsers are at risk, while those using fixed, trusted definitions are not. That makes reviewing where parser definitions originate as important as patching.

What to do

  • Upgrade binary-parser to version 2.3.1 or later in every Node.js project that uses it.
  • Audit your code for any parser definitions built from user-supplied or external input.
  • Replace expressions such as 'len - 1' in parser options with a function, since the fixed version rejects them.
  • Check dependency lists for binary-parser, including indirect use, and confirm no version before 2.3.1 remains.
binary-parser Node.js code injection CVE-2026-134814 supply chain vulnerability
Answering to more than one framework? Run them as one security and AI governance programme ->

Summarised by CISO AI from The Hacker News, written with Claude Sonnet 5.5. We link back to every original so you can read it yourself.