Binary-parser flaw lets parser definitions run JavaScript
The binary-parser vulnerability allows attackers who control parser definitions to inject and execute JavaScript in the Node.js process where a parser is compiled. The flaw affects binary-parser versions before 2.3.1 and is tracked as CVE-2026-134814, with severity scores of 9.2 and 8.1 under different CVSS assessments. CVSS, the Common Vulnerability Scoring System, is a standard way to describe how serious a security flaw is.
Binary-parser is a library that helps Node.js applications read binary data, such as structured data made up of fields and values. The problem is not the ordinary use of a trusted parser definition to process untrusted binary data. The project maintainer said that scenario is not affected. The risk arises when an attacker can supply or change the instructions that define how the parser should be built.
According to the description in the NIST National Vulnerability Database, the affected versions pass string-based options through Context.generateOption() without adequate validation. Those values are inserted into generated JavaScript code. An attacker who controls a parser definition can therefore provide crafted values that become executable code when the parser is compiled. Code injection means that data supplied to an application is treated as instructions instead of remaining ordinary data.
The affected options include length, lengthInBytes, key, tag and offset. The alias supplied to namely() is also involved. The flaw allows crafted values in those fields to execute arbitrary JavaScript, meaning code chosen by the attacker, inside the host Node.js process. Depending on the application using the library, that process may have access to the same data and resources available to the application itself.
The project maintainer disclosed the issue in an advisory released on November 11, 2026. The maintainer said the underlying cause was the direct insertion of some user-controlled string options into generated JavaScript. In the fix, these options are validated as identifier paths, such as foo or $parent.len. Expressions such as len - 1 are rejected. Applications that need that kind of calculation should use a function instead.
CVE-2026-134814 is also described as an incomplete fix for CVE-2026-1245, another code injection vulnerability with a CVSS score of 6.5. That earlier issue was fixed in January 2026 and involved insufficient validation of field names and encoding parameters. Upwind Security said the newer flaw lets attackers controlling parser definitions inject and execute arbitrary JavaScript in the host Node.js process when the parser is compiled.
Users of binary-parser should update to version 2.3.1 or the latest available version, review who can create or modify parser definitions, and avoid treating untrusted definitions as safe configuration. AEU-I provides security-first IT, infrastructure and consulting, which is relevant for teams assessing where parser definitions are accepted and how software dependencies are managed.