A significant security vulnerability has been identified in the widely-used binary-parser library, presenting a risk for arbitrary code execution through malicious parser definitions. This vulnerability, cataloged as CVE-2026-134814, affects versions of binary-parser prior to 2.3.1.
Details of the Vulnerability
The flaw, which carries a CVSS score of 9.2, involves code injection via unvalidated string-typed options in the binary-parser’s Context.generateOption() function. Attackers who control parser definitions can exploit this weakness by providing specifically crafted values for fields such as length, lengthInBytes, key, tag, offset, or alias values in the namely() function. This can result in the execution of arbitrary JavaScript within the Node.js process during parser compilation.
Project Maintainer’s Advisory
On November 11, 2026, the maintainer of the library released an advisory highlighting the root cause of the vulnerability. It was noted that certain user-controlled options were directly integrated into the generated JavaScript without proper validation. To address this, the library now validates these options as identifier paths, rejecting expressions like ‘len – 1’ in favor of using functions.
Keichi Takahashi, the library’s maintainer, emphasized that parsing untrusted binary data using a trusted parser definition remains unaffected. The update ensures that options such as length and offset are adequately validated to prevent exploitation.
Connection to Previous Vulnerabilities
This vulnerability is also considered an incomplete patch of a prior issue, CVE-2026-1245, which had a lower CVSS score of 6.5 and was addressed in January 2026. The earlier flaw stemmed from inadequate validation of field names and encoding parameters, which has now been further corrected.
The security firm Upwind Security has warned users via social media, urging them to update to the latest version of the library to mitigate potential risks. This update is essential for maintaining optimal security against code injection attacks.
Users are strongly advised to upgrade their installations to the most recent version of binary-parser to protect their systems from possible exploits. Keeping software up-to-date is a crucial aspect of safeguarding against emerging cybersecurity threats.
