Newshot

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

Summary

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

Original text(via The Hacker News)

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 -

  • lengthInBytes
  • 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.

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by The Hacker News
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗