A code injection flaw in binary-parser versions before 2.3.1 lets attackers who control parser definitions execute arbitrary JavaScript in a Node.js process. Maintainer Keichi Takahashi says parsing untrusted binary data with a trusted parser definition is not affected.
A critical code injection flaw in binary-parser versions before 2.3.1 lets attackers who control parser definitions execute arbitrary JavaScript in a Node.js process. The flaw, CVE-2026-134814, carries a CVSS score of 9.2/8.1.
The flaw affects binary-parser versions before 2.3.1. It sits in Context.generateOption(), which inserted some user-controlled string options into generated JavaScript code without adequate validation, according to an advisory published Nov. 11, 2026, by maintainer Keichi Takahashi.
Attackers can supply crafted values for length, lengthInBytes, key, tag, offset or the alias passed to namely() to run JavaScript during parser compilation. The NVD entry for CVE-2026-134814 describes the issue as code injection through string-typed options passed unvalidated by Context.generateOption().
"Parsing untrusted binary data with a trusted parser definition is not affected," Takahashi said. "These options are now validated as identifier paths (e.g. foo, $parent.len). Expressions such as 'len - 1' are rejected; use a function instead."
The fix validates those options as identifier paths, such as foo or $parent.len. Expressions such as len - 1 no longer pass; developers should use a function for calculated values.
CVE-2026-134814 also represents an incomplete fix for CVE-2026-1245, a code injection flaw fixed in January 2026 that stemmed from insufficient validation of field names and encoding parameters. That earlier flaw carried a CVSS score of 6.5.
Upwind Security said in a post on X that the flaw lets attackers who control parser definitions inject and execute arbitrary JavaScript in the host Node.js process during parser compilation.
The risk applies to Node.js applications that build parsers from definitions an attacker can influence. Teams that accept parser definitions from users, plugins or configuration files face the highest exposure.
Users should update to binary-parser 2.3.1 or later. Teams should review where parser definitions come from, because a definition becomes code once compiled. Avoid expressions in the affected options; use functions for dynamic lengths or keys. Dependencies that wrap binary-parser also need updates and review. The project's source repository lists the current release and change history.
The NVD entry for CVE-2026-1245 provides details on the earlier related flaw.
Source : Critical binary-parser Flaw Enables JavaScript Injection via Malicious Parser Definitions , by The Hacker News , The Hacker News , Nov 23, 2026
