---
title: npm binary-parser before 2.3.1: attacker-controlled parser definitions can inject JavaScript (CVE-2026-134814) | ctxsec
url: https://ctxsec.com/items/binary-parser-cve-2026-134814-code-injection-parser-definitions-fixed-2-3-1
description: "String options such as length, lengthInBytes, key, tag, offset and namely() aliases were pasted unvalidated into the generated parser code, so anyone who can shape a parser definition can run code in the Node.js process when it compiles. Only apps that build parsers from untrusted input are exposed. Upgrade to 2.3.1. CVSS 4.0 9.2 / 3.1 8.1; no exploitation reported."
status: "official (GitHub advisory GHSA-xmxc-6c22-m377 and CVE record by VulnCheck)"
published: 2026-11-23
---

> String options such as length, lengthInBytes, key, tag, offset and namely() aliases were pasted unvalidated into the generated parser code, so anyone who can shape a parser definition can run code in the Node.js process when it compiles. Only apps that build parsers from untrusted input are exposed. Upgrade to 2.3.1. CVSS 4.0 9.2 / 3.1 8.1; no exploitation reported.

[← Cybersecurity News](/news) · [markdown](/items/binary-parser-cve-2026-134814-code-injection-parser-definitions-fixed-2-3-1.md)

official (GitHub advisory GHSA-xmxc-6c22-m377 and CVE record by VulnCheck)

2026-11-23 2:47 PM ET

### npm binary-parser before 2.3.1: attacker-controlled parser definitions can inject JavaScript (CVE-2026-134814)

- Affected: binary-parser (npm, keichi) before 2.3.1. Fixed: 2.3.1.
- Cause: Context.generateOption() passed string options into generated JavaScript without validation.
- Exposure needs attacker control over the parser definition (schema), not just the bytes being parsed. Review where your schemas come from.

Sources: [GitHub advisory GHSA-xmxc-6c22-m377 (binary-parser)](https://github.com/keichi/binary-parser/security/advisories/GHSA-xmxc-6c22-m377) · [CVE.org: CVE-2026-134814](https://www.cve.org/CVERecord?id=CVE-2026-134814)
