The developer of binary-parser, a JavaScript library for parsing binary data, disclosed on November 11, 2026, a vulnerability (GHSA-xmxc-6c22-m377) that can let string-typed options in a parser definition execute arbitrary JavaScript. Versions 2.3.0 and earlier are affected, and version 2.3.1, released the same day, fixes the issue. The severity is rated "High," with a CVSS v3.1 base score of 8.1.

Versions Up to 2.3.0 Are Affected; 2.3.1 Is the Fix

The key details of the security advisory published on GitHub are summarized in the table below. The weakness is classified as CWE-94 (Improper Control of Generation of Code).

ItemDetails
IdentifierGHSA-xmxc-6c22-m377
Packagebinary-parser (npm)
Affected versions2.3.0 and earlier
Patched version2.3.1
SeverityHigh (CVSS v3.1: 8.1)
DisclosedNovember 11, 2026

As of this writing, the advisory does not list a CVE number. GitHub user "zachariah-mithani" is credited as the finder.

String Options Were Inserted Verbatim Into Generated Code

binary-parser is a library for building binary data parsers in a declarative style. It generates parser source code from the definition a developer writes, then runs that code to do the parsing.

The problem arose at that code-generation step. According to the advisory, the fix for an earlier vulnerability (CVE-2026-1245) added validation for field names and encoding names, but other string-typed options were still interpolated into the generated parser source without validation. The advisory lists the following options as injection points:

  • "length" on string / buffer / array / wrapped / seek
  • "lengthInBytes" and "key" on array
  • "tag" on choice
  • "offset" on pointer
  • the alias passed to "namely()"

In other words, a crafted string placed in one of these values is treated as part of the code and executed inside the Node.js or other process running the parser.

The Risk Lies in Accepting Definitions From Outside

The attack requires that the attacker be able to control the parser definition itself. The advisory gives schema- or JSON-driven parsers as an example. On the other hand, it states that parsing untrusted binary data with a trusted parser definition is not affected.

The CVSS rating reflects this precondition. The attack vector is the network, no privileges or user interaction are required, and the impact on confidentiality, integrity and availability is rated "High" across the board. However, attack complexity is also rated "High," which is what keeps the base score at 8.1.

2.3.1 Accepts Only Identifier Paths

According to the 2.3.1 release notes, the patched version validates the options above as identifier paths such as "foo" or "$parent.len." Passing an expression such as "len - 1" as a string is rejected when the parser is compiled.

This is also a breaking change. Code that specified lengths or other values as expressions needs to be rewritten as a function, for example "function () { return this.len - 1; }." The release notes urge applications that build parser definitions from untrusted input to upgrade.

As of this writing, the latest version is 3.0.0, which builds on 2.3.1. Version 3.0.0 also brings other major changes, including becoming ES module-only and requiring Node.js 22.12 or later.

Our Take

The fix shipped alongside the disclosure, and the conditions for being affected are clearly spelled out, which makes it easy for users to judge their exposure. For the many projects that hard-code their parser definitions, there is likely no immediate risk of exploitation.

That said, binary-parser may also be pulled in as a dependency of other packages. Even if a project does not accept definitions from outside, a library it depends on might. Still, apart from the loss of string expressions in 2.3.1, the effort required to respond is modest. Checking the dependency tree and updating early is the safe choice.

Summary

A vulnerability in binary-parser 2.3.0 and earlier allowed string options in parser definitions to execute arbitrary JavaScript, and it has been fixed in 2.3.1. Applications that build parsers from definitions received from outside are the ones affected. Because values written as expressions must be rewritten as functions, developers should also review how their definitions are written when updating.