Keichi binary-parser flaw allows JavaScript injection via CVE-2026-134814
TL;DR
The keichi binary-parser library contains a critical code injection flaw, CVE-2026-134814, affecting versions prior to 2.3.1. If your application uses schema- or JSON-driven parser definitions, update to version 2.3.1 immediately to prevent arbitrary JavaScript execution.
What happened
A critical vulnerability in binary-parser allows attackers to execute arbitrary JavaScript within a host Node.js process during the parser compilation phase. The flaw, tracked as CVE-2026-134814 (CVSS 9.2), occurs because the Context.generateOption() function fails to validate certain string-typed options.
Attackers who can control parser definitions can supply crafted values for length, lengthInBytes, key, tag, offset, or the alias passed to namely(). These values are inserted directly into the generated JavaScript code without adequate validation. This vulnerability is an incomplete fix for CVE-2026-1245, which was addressed in January 2026 but only covered field names and encoding parameters.
Why it matters
This is a high-impact supply chain risk for developers using dynamic parser generation. While parsing untrusted binary data with a trusted definition is not affected, any system that allows users to define or influence the parser schema itself is vulnerable. An attacker can move from defining a data structure to executing full code within your Node.js environment. The risk is particularly acute for applications using JSON or schema-driven configurations to build their parsers on the fly.
Who is affected
binary-parserversions prior to 2.3.1
What to do now
- Update
binary-parserto version 2.3.1 or later. - Ensure that parser definitions are never controlled or influenced by untrusted users.
- Replace mathematical expressions in options (e.g.,
len - 1) with function calls to comply with the new validation requirements.
What we don't know yet
- Whether this vulnerability has been exploited in the wild.
- The total number of downstream applications affected by this flaw.
Sources
- thehackernews.comhttps://thehackernews.com/2026/11/critical-binary-parser-flaw-enables.html
- github.comhttps://github.com/keichi/binary-parser/security/advisories/GHSA-xmxc-6c22-m377
- github.comhttps://github.com/keichi/binary-parser/commit/110206bb126a80071158fb0e2e3d7cc658f2bfe4
- github.comhttps://github.com/keichi/binary-parser/commit/4b26e04c396253e704ad8e41b928d9e31316f62e
- github.comhttps://github.com/keichi/binary-parser/blob/v2.3.0/lib/binary_parser.ts#L26-L35
- nvd.nist.govhttps://nvd.nist.gov/vuln/detail/cve-2026-134814
