binary-parser — Critical JavaScript Injection Flaw Enables Arbitrary Execution via Malicious Parser Definitions (CVE-2026-134814)
Publication date: November 23, 2026
Category: Vulnerability / Open Source
Introduction
A critical security flaw has been disclosed in the widely used binary-parser library, which could allow an attacker who controls parser definitions to execute arbitrary code within the host process. The primary vulnerability, tracked as CVE-2026-134814, is a severe case of code injection impacting versions of the library prior to 2.3.1. Initial disclosures and technical reports detail how improper handling of string-typed options exposes Node.js applications to remote code execution (RCE) during the parser compilation phase. This bulletin examines the technical vectors involved, their connection to prior vulnerabilities, and necessary remediation steps to secure software supply chains.
What is binary-parser? (General Analysis)
binary-parser is a popular Node.js module that enables developers to build high-performance binary parsers using declarative JavaScript syntax. Its core purpose is to efficiently deserialize complex binary data streams, transforming them into structured objects easily readable by JavaScript applications.
The severity of the flaw lies within the core functionality of the library: compiling user-defined parsing rules into optimized executable JavaScript code to maximize processing speed. If an attacker manages to manipulate or control the parser definitions supplied to the library, they can inject arbitrary instructions that will be evaluated automatically when the parser is compiled and instantiated.
Summary of Confirmed Vulnerabilities (NVD Data)
| CVE | Category (CWE) | Impact | CVSS | Vector (summarized) |
|---|---|---|---|---|
| CVE-2026-134814 | CWE-94 (Code Injection) | Critical | 9.2 (CVSS v4.0) | AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H |
| CVE-2026-1245 | CWE-94 (Code Injection) | Medium | 6.5 (CVSS v3.1) | AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
Note: Both CWE classifications (CWE-94) and CVSS scores are official facts confirmed by the National Vulnerability Database (NVD).
How Does It Work? (Technical Analysis)
The technical mechanism behind CVE-2026-134814 originates from how the Context.generateOption() method processes string-typed parameters. Specifically, options such as length, lengthInBytes, key, tag, offset, or the alias passed to the namely() function are inserted directly into dynamically generated JavaScript code without performing strict identifier path validation.
- Initial exploit vector flow: The attacker supplies manipulated option values (for instance, complex expressions instead of simple identifiers like
fooor$parent.len) through untrusted parser definitions sourced externally. - Interpolation and compilation: During the binary-parser compilation phase, the library takes these strings and concatenates them directly into evaluated functions (such as
evalor equivalent function constructors within the Node.js runtime) without prior sanitization. - Code execution in the host process: When the parser is compiled, the injected malicious expression is evaluated within the context of the Node.js process, granting the attacker arbitrary code execution capabilities under the privileges of the running service.
- Relationship with CVE-2026-1245: This new flaw is analytically viewed as an incomplete fix for CVE-2026-1245, a vulnerability reported earlier in January 2026 that also involved code injection resulting from insufficient validation of field names and encoding parameters.
“Binary-parser before 2.3.1 contains a code injection vulnerability that allows attackers controlling parser definitions to inject JavaScript through string-typed options passed unvalidated by Context.generateOption(). Attackers can supply crafted length, lengthInBytes, key, tag, offset, or namely() alias values to execute arbitrary JavaScript in the Node.js process when the parser is compiled.” — National Vulnerability Database (NVD)
Affected Systems / Environments
The impact of these vulnerabilities affects any development environment or Node.js-based application that utilizes binary data parsing libraries and processes parser definitions originating from untrusted or external sources.
- Affected library:
binary-parserin versions prior to2.3.1. - Affected ecosystem: Node.js backend applications utilizing binary stream deserialization via dynamic configurations.
- Security assumption: Parsing untrusted binary data with a trusted, static parser definition is not affected. Risk arises strictly when an attacker succeeds in influencing the parser definition itself.
Mitigation and Detection
Remediation
The primary and definitive mitigation measure is updating the library to its latest version. The maintainers have introduced strict validation checks to ensure options are interpreted strictly as valid identifier paths.
- Dependency update: Immediately upgrade the
binary-parserdependency to version2.3.1or later using your project’s package manager:bashnpm install binary-parser@latest - Definition review: Conduct source code audits to ensure no parser definitions accept unvalidated dynamic parameters (such as direct mathematical expressions like
len - 1, which should be replaced by explicit functions). - Principle of least privilege: Execute Node.js processes under service accounts with minimal privileges on the operating system to limit potential impact in the event of hypothetical exploitation.
Detection
Defensive teams (Blue Team) should implement monitoring guidelines and static analysis routines to identify vulnerable version usage and potential definition tampering attempts.
- Dependency auditing: Integrate Software Composition Analysis (SCA) tools and audit commands into continuous integration (CI/CD) pipelines:
bash
npm audit - Behavioral monitoring: Monitor for unusual child process creation or calls to dynamic evaluation functions (
eval,Function) originating from the binary parsing library context within Application Performance Monitoring (APM) traces.
Wrapping Up
The discovery of CVE-2026-134814 in binary-parser highlights the inherent risks of dynamic code generation derived from complex configuration inputs. By allowing string-typed values to bypass strict identifier validation, the library exposed host processes to arbitrary JavaScript execution. With the release of version 2.3.1 and the enforcement of strict identifier path validation, developers have the mechanisms required to neutralize this vector. Rigorous adoption of these updates and review of untrusted parsing schemas remain fundamental steps to safeguarding Node.js application integrity.
References
- Takahashi, K. (2026). binary-parser repository and security advisory. GitHub. https://github.com/keichi/binary-parser
- National Institute of Standards and Technology. (2026). NVD - CVE-2026-134814 Detail. U.S. Department of Commerce. https://nvd.nist.gov/vuln/detail/cve-2026-134814
- GitHub. (2026). Advisory: Code injection in binary-parser via string-typed options (GHSA-xmxc-6c22-m377). https://github.com/keichi/binary-parser/security/advisories/GHSA-xmxc-6c22-m377
- VulnCheck. (2026). binary-parser before 2.3.1 code injection via string-typed parser options. VulnCheck Advisories. https://www.vulncheck.com/advisories/binary-parser-before-2.3.1-code-injection-via-string-typed-parser-options
- CERT/CC. (2026). Vulnerability Note VU#102648. Carnegie Mellon University. https://kb.cert.org/vuls/id/102648
- npm. (2026). binary-parser package registry. npm, Inc. https://www.npmjs.com/package/binary-parser