
A code injection flaw in binary-parser, a popular npm library for reading binary data in Node.js, can let an attacker run arbitrary JavaScript if they control the parser definition. The Hacker News reports the flaw as CVE-2026-134814 and cites the National Vulnerability Database description. It scores 8.1 (High) in the project’s own GitHub advisory; The Hacker News lists CVSS scores of 9.2 and 8.1.
The library builds JavaScript source code from the options in a parser definition and compiles it. According to the advisory published by the maintainer on November 11, several string-typed options were placed into that generated code without validation: the length of string, buffer, array, wrapped and seek fields, lengthInBytes and key of arrays, the tag of a choice, the offset of a pointer, and the alias passed to namely(). A crafted value is then executed when the parser is compiled. The advisory is explicit about the limit of the risk: parsing untrusted binary data with a trusted parser definition is not affected. The danger is in applications that build parser definitions from outside input, such as schema-driven or JSON-driven parsers.
The Hacker News describes the bug as an incomplete fix for CVE-2026-1245, an earlier code injection flaw in the same library that it says was fixed in January 2026. The advisory says the same: that fix validated field names and encodings, but other string options were still interpolated verbatim. Upwind Security, quoted by The Hacker News from an X post, described the impact as arbitrary JavaScript executing inside the host Node.js process when the parser is compiled. The sources do not report any exploitation in the wild.
How to check if you’re affected
Affected versions are binary-parser releases up to and including 2.3.0, per the GitHub advisory; The Hacker News words it as versions prior to 2.3.1. The patched version is 2.3.1.
- Find out whether you use the library and which version:
npm ls binary-parserlists it, including copies pulled in by other packages (a standard npm command, not something the advisory states). - Check whether any parser definition in your code is built from data an outsider can influence. If definitions are fixed in your source code, the advisory says this flaw does not apply to them.
- Update to 2.3.1. The advisory says the affected options are now validated as identifier paths such as
fooor$parent.len, and expressions such aslen - 1are rejected, so a definition that relied on an expression needs a function instead.
Sources
- GitHub advisory GHSA-xmxc-6c22-m377: Code injection via string options in binary-parser (High, 8.1; affected
<= 2.3.0, patched 2.3.1; the page lists no CVE ID) - NVD entry for CVE-2026-134814 (the page is script-rendered, so we did not read it; its description is quoted via The Hacker News)
- The Hacker News: Critical binary-parser Flaw Enables JavaScript Injection via Malicious Parser Definitions
