Skip to main content

CVE-2026-134814: binary-parser JavaScript Injection RCE Teardown

Defensive teardown of CVE-2026-134814 in binary-parser before 2.3.1: root cause, patch commands, detection rules, and hardening checklist for DevSecOps teams.

BREACHES & CVES Security Advisory
Critical binary-parser Flaw Enables JavaScript Injection via Malicious Parser Definitions
Critical binary-parser Flaw Enables JavaScript Injection via Malicious Parser Definitions Source: thehackernews.com
Field Note · The Short Version 3 min read

CVE-2026-134814 is a critical code injection flaw in binary-parser before 2.3.1 that lets attackers inject JavaScript through unvalidated string-typed parser options via Context.generateOption(); upgrade to 2.3.1 or later.

Key Numbers & Verified Specs

7 metrics
Metric / Spec Verified Finding Source
CVE ID CVE-2026-134814 github.com
CVSS v4 Score 9.2 Critical github.com
Affected Versions binary-parser before 2.3.1 github.com
Patched Version binary-parser 2.3.1 or later github.com
Vulnerable Function Context.generateOption() github.com
Attack Vector Network, Attack Complexity High, Privileges Required None github.com
CISA KEV Status Not listed as of publication cisa.gov
Jump to section (4) +

CVE-2026-134814 is a critical code injection vulnerability in the binary-parser npm package. Versions before 2.3.1 allow attackers who control parser definitions to inject JavaScript through string-typed options passed unvalidated by Context.generateOption(). The flaw yields arbitrary JavaScript execution inside the Node.js process when a malicious parser is compiled. CVSS v4 scores this at 9.2 Critical with network attack vector, high attack complexity, no privileges required, and no user interaction.

Incident Timeline & Blast-Radius Table

ItemDetailSource
CVE IDCVE-2026-134814GitHub Advisory Database
CVSS v4 Base Score9.2 CriticalGitHub Advisory Database
Affected Versionsbinary-parser < 2.3.1GitHub Advisory Database
Patched Versionbinary-parser >= 2.3.1Patch Commit 110206b
Vulnerable FunctionContext.generateOption()binary_parser.ts v2.3.0 lines 26-35
Attack VectorNetwork, High Complexity, None RequiredGitHub Advisory Database
CISA KEV ListedNoCISA KEV Catalog
PublishedNov 22, 2026 (NVD), Nov 23, 2026 (GitHub)GitHub Advisory Database

The blast radius covers any Node.js service that accepts user-supplied or externally controlled parser definition objects. Backend maintainers using binary-parser to decode proprietary binary protocols, file formats, or telemetry streams are directly exposed if attacker-controlled input reaches parser option fields. Services that hardcode parser definitions internally and never accept external definition payloads face a narrower exposure window.

Technical Root Cause & Attack Vector (Defensive Analysis)

The vulnerability lives in Context.generateOption(), which builds parser option strings without sanitizing attacker-controlled input. When a parser definition includes crafted values for length, lengthInBytes, key, tag, offset, or namely() aliases, those strings are interpolated into generated JavaScript. The Node.js process then executes that code during parser compilation.

This is a classic unsafe code-generation pattern. String-typed options flow directly into a code string that is evaluated or compiled at runtime. Because the attack vector is network-based and requires no privileges or user interaction, an attacker who can influence parser definition configuration achieves remote code execution in the application context.

The root cause is missing input validation and unsafe string interpolation in generated parser code. Defensive remediation requires validating all parser option values against an allowlist before they reach the code-generation path, or upgrading to a version that performs this validation.

Critical binary-parser Flaw Enables JavaScript Injection via Malicious Parser Definitions
Critical binary-parser Flaw Enables JavaScript Injection via Malicious Parser Definitions

Exact Patch, Upgrade & Verification Commands

Upgrade binary-parser immediately. The fix landed in version 2.3.1.

Bash12 lines
# Check current installed version
npm ls binary-parser

# Upgrade to patched version
npm install binary-parser@2.3.1

# Verify the installed version after upgrade
node -e "const p = require('binary-parser/package.json'); console.log(p.version)"

# Yarn alternative
yarn upgrade binary-parser@2.3.1
yarn list --pattern binary-parser

If an immediate upgrade is impossible, audit every parser definition source. Reject any definition object whose option fields contain executable-looking strings, template literals, or unexpected characters. Treat parser definitions as untrusted code configuration until the package is patched.

Detection Rules & Hardening Checklist

Monitor Node.js processes for anomalous parser compilation behavior. Look for child process spawning, unexpected network connections, or file system writes from services that use binary-parser. Enable audit logging on parser definition ingestion endpoints.

  • Pin binary-parser to 2.3.1 or later in package.json and lockfiles.
  • Run npm audit or yarn audit regularly to catch reintroduced vulnerable versions.
  • Block parser definition uploads from untrusted sources at the API gateway.
  • Validate all string-typed parser options against strict allowlists before passing them to binary-parser.
  • Isolate binary-parser workloads in containers with non-root users and read-only filesystems where possible.
  • Review GitHub Dependabot alerts for GHSA-hhq6-2gpv-hrf4.

When NOT to use this guidance: If your service generates parser definitions entirely from internal, hardcoded sources and never accepts external definition payloads, the immediate exploitation risk is lower, though you should still upgrade to eliminate supply-chain risk. Do not attempt to patch binary-parser by monkeypatching Context.generateOption() at runtime; that approach is fragile and may break parser compilation.

Primary sources: GitHub Advisory Database, NVD CVE Detail, The Hacker News coverage.

Reader Q&A

Frequently Asked Questions

Which versions of binary-parser are affected by CVE-2026-134814?
All versions of binary-parser before 2.3.1 are affected. Version 2.3.1 contains the patch. Verify your installed version with npm ls binary-parser or yarn list --pattern binary-parser.
How does the Context.generateOption() injection work?
Attackers who control parser definitions can pass crafted string-typed options such as length, lengthInBytes, key, tag, offset, or namely() alias values. These values flow unvalidated into generated JavaScript code, achieving arbitrary code execution in the Node.js process when the parser is compiled.
Is CVE-2026-134814 on the CISA Known Exploited Vulnerabilities catalog?
No. CISA KEV does not currently list CVE-2026-134814. Teams should still treat it as critical due to the CVSS 9.2 score and remote network attack vector.

Bibliography & Verification

Primary Sources & References

4 cited sources
  1. [01] github.com advisories / GHSA-hhq6-2gpv-hrf4
  2. [02] nvd.nist.gov vuln / detail / cve-2026-134814
  3. [03] thehackernews.com 2026 / 11 / critical-binary-parser-flaw-enables.html
  4. [04] github.com binary-parser / commit / 110206bb126a80071158fb0e2e3d7cc658f2bfe4

Human × Agent Co-Work

Hamdi Soudani · in collaboration with Pyvren

Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.

Hamdi Soudani × Pyvren

Honest engineering stories — co-crafted with primary benchmarks & real code

Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.