Critical Code Injection Flaw in binary-parser Library Enables Arbitrary JavaScript Execution via Malicious Parser Definitions

A critical security vulnerability tracked as CVE-2026-134814 has been disclosed in the widely used binary-parser library, allowing attackers who control parser definitions to inject and execute arbitrary JavaScript code in Node.js environments. The flaw affects all versions prior to 2.3.1 and carries a CVSS score of 9.2, stemming from insufficient validation of user-controlled string options such as length, lengthInBytes, key, tag, offset, and namely() aliases that are directly inserted into generated JavaScript code. This issue represents an incomplete remediation of the earlier CVE-2026-1245 vulnerability, which was addressed in January 2026 but left gaps in field name and encoding parameter validation. According to the project maintainer Keichi Takahashi, only scenarios where attackers can supply malicious parser definitions are impacted, while parsing untrusted binary data with trusted definitions remains unaffected. The NIST National Vulnerability Database and Upwind Security have highlighted the risk, urging immediate updates to version 2.3.1 where options are now validated as identifier paths and expressions are rejected in favor of functions.

The Hacker NewsTranslated from English

Read at source

A critical security flaw has been disclosed in the popular binary-parser library that could allow an attacker who controls parser definitions to execute arbitrary code.

The vulnerability, tracked as CVE-2026-134814 (CVSS score: 9.2 / 8.1), is a case of code injection impacting binary-parser versions prior to 2.3.1.

"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()," according to a description of the flaw in the NIST National Vulnerability Database (NVD).

"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."

According to an advisory released by the project maintainer on November 11, 2026, the problem arose from the fact that some user-controlled string options were inserted directly into the generated JavaScript code without adequate validation. The parser options include length, lengthInBytes, key, tag, offset, and the alias passed to namely().

"Parsing untrusted binary data with a trusted parser definition is not affected," Keichi Takahashi, who maintains the library, said. "These options are now validated as identifier paths (e.g. foo, $parent.len). Expressions such as 'len - 1' are rejected; use a function instead."

CVE-2026-134814 can also be viewed as an incomplete fix for CVE-2026-1245 (CVSS score: 6.5), another code injection vulnerability that was fixed back in January 2026 and resulted from insufficient validation of field names and encoding parameters.

"[The flaw] allows attackers controlling parser definitions to inject and execute arbitrary JavaScript within the host Node.js process upon parser compilation," Upwind Security said in an X post. Users are advised to update to the latest version of the library for optimal protection.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Vulns & Exploits

Docker Sandboxes Flaw Allows Malicious Kits to Exfiltrate AI API Keys Without User Prompts
OFFIS DCMTK Toolkit Hit by Critical Missing Authorization and Partial String Comparison Flaws
CISA Warns of Critical Vulnerabilities in Nextgen Healthcare Mirth Connect Allowing Arbitrary Script Execution and Man-in-the-Middle Attacks