VYPR
researchPublished Nov 23, 2026· 1 source

Critical Flaw in binary-parser Library Allows JavaScript Injection

A critical code injection vulnerability (CVE-2026-134814) in the binary-parser library, affecting versions prior to 2.3.1, allows attackers to execute arbitrary JavaScript code by controlling parser definitions.

A significant security vulnerability has been discovered in the widely-used binary-parser JavaScript library, potentially enabling attackers to inject and execute arbitrary JavaScript code. The flaw, identified as CVE-2026-134814, carries a high CVSS score of 9.2, indicating a severe risk to systems relying on this library.

The vulnerability arises from an issue in how the library handles string-typed options passed to its Context.generateOption() function. Versions of binary-parser prior to 2.3.1 fail to adequately validate these options, allowing malicious input to be directly incorporated into the generated JavaScript code during parser compilation. This can lead to the execution of arbitrary JavaScript within the Node.js process hosting the parser.

Attackers can exploit this vulnerability by crafting specific values for parser options such as length, lengthInBytes, key, tag, offset, or aliases defined using namely(). When these crafted options are used to compile a parser, the injected JavaScript code is executed. The maintainer of the library, Keichi Takahashi, clarified that parsing untrusted binary data with a trusted parser definition is not affected by this specific flaw. The issue lies in the control an attacker can gain over the parser definition itself.

This newly disclosed vulnerability is also considered an incomplete fix for a previous code injection flaw, CVE-2026-1245, which was addressed in January 2026. That earlier vulnerability also stemmed from insufficient validation of field names and encoding parameters, highlighting a recurring security challenge within the library's parsing mechanisms.

Upwind Security, in an X post, highlighted the severity of CVE-2026-134814, noting that it allows for the injection and execution of arbitrary JavaScript directly within the host Node.js process during parser compilation. They strongly advise users to update to the latest version of the library to mitigate this risk.

The fix implemented by the project maintainer involves validating these string options as identifier paths, such as foo or $parent.len. Expressions like 'len - 1' are now rejected, and users are encouraged to use functions for more complex calculations, ensuring that user-controlled input cannot be directly interpreted as executable code.

Given the widespread use of Node.js in backend development and the critical nature of code injection vulnerabilities, this flaw poses a substantial threat. Developers utilizing the binary-parser library are urged to apply the update to version 2.3.1 or later immediately to protect their applications and the underlying systems from potential compromise.

Synthesized by Vypr AI
Critical Flaw in binary-parser Library Allows JavaScript Injection · VYPR