binary-parser Code Injection Vulnerability Allowing Arbitrary Code Execution

Vulnerability

A code injection vulnerability has been identified in the binary-parser library for Node.js, affecting versions prior to 2.3.0. This vulnerability allows the execution of arbitrary JavaScript code when untrusted input is used in parser field names or encoding parameters. The library dynamically generates parser code at runtime, incorporating these untrusted values without proper validation or sanitization. As a result, attackers can manipulate the generated code to execute malicious scripts within the Node.js process, potentially leading to unauthorized access to local data, manipulation of application logic, or execution of system commands, depending on the deployment environment.

Impact

Exploitation of this vulnerability could result in arbitrary code execution within the context of the Node.js process, allowing attackers to execute malicious JavaScript code with the same privileges as the Node.js application.

Reproduction

To reproduce this vulnerability, create a binary-parser instance and use untrusted input for field names or encoding parameters. When the parser is executed, the injected code will be executed in the Node.js environment.

Remediation

Users should upgrade to binary-parser version 2.3.0 or later, where input validation has been implemented to prevent this vulnerability. Additionally, developers should avoid using untrusted data in parser definitions.

Added: Jan 20, 2026, 7:25 PM
Updated: Jan 21, 2026, 12:21 AM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
7.7
remediation
0.0
relevance
2.2
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.