Get DeafLetter
A weekly selection of signals, vulnerabilities and guides. Critical alerts remain optional.
You can unsubscribe at any time. Privacy policy.
Maintainer Keichi Takahashi published the security advisory GHSA-xmxc-6c22-m377 on November 11, 2026 for CVE-2026-134814, a code injection vulnerability in the npm library binary-parser affecting all versions prior to 2.3.1. The flaw scores CVSS 9.2 (v4.0, CRITICAL) with a legacy v3.1 equivalent of 8.1 HIGH, per official NVD and CVE.org records. The impact is arbitrary JavaScript execution in the Node.js process.
This is the second incident in ten months on the same attack surface. In January 2026, CVE-2026-1245 (CVSS 6.5 MEDIUM) addressed a similar vector, but the patch only covered field names and encoding parameters. Other string fields remained freely interpolated into the generated code.
- The
binary-parserlibrary (< 2.3.1) dynamically generates JavaScript code vianew Function()from user-supplied definitions, without validating string options such aslength,lengthInBytes,key,tag,offset, andnamely()aliases. - Parsing untrusted binary data with a trusted parser definition is not affected: the attacker must control the parser definitions, not the data being parsed.
- The fix in version 2.3.1 validates options as JavaScript identifiers via regex
/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, blocking arbitrary expressions. - Public PoCs and Nuclei detection templates exist; EPSS stands at 0.6% and the CVE is not listed in the CISA KEV catalog.
Verified Facts: How the Vulnerability Works
The binary-parser library transforms declarative binary format definitions into optimized JavaScript parsers. The core of the process is dynamic code generation: the Context class builds source strings that are passed to new Function() to produce the compiled parser.
The function Context.generateOption() directly concatenated user-controlled string values into the generated code template. According to the official CVE record, the specific vulnerable fields are length, lengthInBytes, key, tag, offset, and aliases created via namely(). An attacker with control over the parser definition could inject JavaScript code executed at compilation time.
Per illustrative technical analysis published by specialized sources, example payloads demonstrate how malicious expressions inserted into vulnerable fields execute during parser generation. These analyses are not independently verified as facts of real-world exploitation.
The distinction is technical but decisive for the threat model. As maintainer Keichi Takahashi stated: "Parsing untrusted binary data with a trusted parser definition is not affected". The at-risk application is one that accepts parser definitions from external sources — end users, third-party plugins, configuration API endpoints — and passes them directly to binary-parser.
The Patch Commit: Closing a Code-Generation Flaw
Commit 110206bb shows the technical implementation of the fix. The maintainer introduced the sanitizeReference() function, which applies the regex /^[a-zA-Z_$][a-zA-Z0-9_$]*$/ to validate that every string value passed to vulnerable fields is a valid JavaScript identifier or a dot-delimited identifier path (e.g., foo, $parent.len).
A second related commit, 4b26e04, extends validation to null-terminated strings for length calculation. Test cases in the first commit verify that payloads resembling 'x+(globalThis.INJECTED=1,0)' trigger an 'Invalid reference' error, confirming the block on arbitrary expressions.
The design choice is significant: rather than implement generic escaping, the maintainer restricted the allowed language to a deterministic subset. Expressions like 'len - 1' are now rejected; the developer must reformulate them as functions. It is a trade-off between expressiveness and security.
"These options are now validated as identifier paths (e.g. foo, $parent.len). Expressions such as 'len - 1' are rejected; use a function instead" — Keichi Takahashi, binary-parser maintainer
The Incomplete-Fix Pattern: Why January Wasn't Enough
The GitHub advisory explains the flaw's genesis: "The fix for CVE-2026-1245 validated field names and encodings, but other string-typed options were still interpolated verbatim into the generated parser source". CVE-2026-1245, resolved in January 2026 with CVSS 6.5, had corrected validation on field names and encoding parameters but left other string parameters passing through generateOption() unchecked.
This pattern raises a process question: does a single maintainer have sufficient resources for comprehensive security audits on niche libraries? The binary-parser case shows how open-source security pressure can produce reactive patches rather than systematic reviews. The discovery by Zachariah Mithani (AploSec) demonstrated the attack surface was broader than estimated in the initial analysis.
The severity jump from 6.5 to 9.2 reflects the difference between a partially contained vector and arbitrary code execution in the host process. CNA VulnCheck assigned the maximum score on the v4.0 scale, signaling complete impact on confidentiality, integrity, and availability.
What to Do Now
The immediate mitigation is upgrading to version 2.3.1 or later, available on npm and GitHub. For those unable to upgrade immediately, the specific check is whether the application accepts parser definitions from untrusted external input.
If definitions come only from static files or reviewed source code, the risk is nil. If instead there are endpoints, dynamically loaded configuration files, or third-party plugins that populate the parser structure, the attack surface is active.
For detection, public Nuclei templates and PoCs verify the vulnerability on exposed instances. The 0.6% EPSS places the CVE at the 50th percentile for exploitation likelihood: not among the most urgent for global patching priority, but the CVSS 9.2 score demands attention on systems processing definitions from external sources.
Editorial Close
CVE-2026-134814 is a case study in the fragility of dynamic code generation. The binary-parser library is not an isolated case: many tools that compile DSLs into executable JavaScript share the same architectural pattern. The distinction between trusted data and trusted definitions is subtle but crucial, and the maintainer correctly isolated the risk perimeter.
The November 2026 fix appears technically sound: the identifier regex is simple, verifiable, and removes the attack class without compromising core functionality. The open question is how many other libraries with dynamic code generation have similar unvalidated parameters. For now, CVE-2026-134814 remains a documented vulnerability with PoCs available but no evidence of active exploitation in the CISA KEV catalog.
Sources
- github.com
- github.com
- github.com
- github.com
- thehackernews.com
- app.opencve.io
- radar.offseq.com
- cve.threatint.com
- cveprofessor.com
- news.lavx.hu
- nvd.nist.gov
- cve.org
Get DeafLetter
A weekly selection of signals, vulnerabilities and guides. Critical alerts remain optional.
You can unsubscribe at any time. Privacy policy.