Code Injection Vulnerability in binary-parser Library

binary-parser Updated 22 Jan 2026

Summary

20/01/2026
MODERATE
Yes i
Moderate
6.5

GHSA-m39p-34qh-rh3w: binary-parser library has a code injection vulnerability. Affects binary-parser versions < 2.3.0. Fixed in 2.3.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The binary-parser library is a popular tool in the Node.js ecosystem that allows developers to define binary data structures and parse binary data efficiently. It is widely used for applications that require reading and writing binary files, such as network protocols and file formats. However, prior to version 2.3.0, the library had a significant vulnerability that allowed for code injection through untrusted input.

Vulnerability Detail

A code injection vulnerability exists in the binary-parser library versions prior to 2.3.0. This vulnerability arises from the library's practice of directly interpolating untrusted values into dynamically generated JavaScript code without proper sanitization. As a result, an attacker can exploit this flaw by providing malicious input in parser field names or encoding parameters, leading to arbitrary code execution within the Node.js process. This could potentially allow attackers to manipulate the application, access sensitive data, or execute harmful operations.

How To Fix

Minimum fixed version

2.3.0

This is the first release that contains the fix.

npm install binary-parser@2.3.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, a temporary workaround is to validate and sanitize all input values used in parser field names and encoding parameters to prevent untrusted data from being executed. However, this is not a substitute for upgrading to the patched version.

Conclusion

The binary-parser library has a critical code injection vulnerability that can lead to severe security risks if untrusted input is processed. It is crucial to update to version 2.3.0 or later to mitigate this risk. Additionally, using tools like Vulert can help monitor and alert for such vulnerabilities in your software.

See every vulnerability recorded for binary-parser →

Share this vulnerability

FAQ

The binary-parser library is used for defining and parsing binary data structures in Node.js applications, making it easier to work with binary files and protocols.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in your software. You can visit the Vulert playground at Vulert Scanner to analyze your package-lock.json file.

The consequences of this vulnerability include the possibility of arbitrary code execution, which can lead to unauthorized access, data manipulation, and other malicious activities within your application.

Yes, the CVSS score for this vulnerability is 6.5, indicating a moderate level of risk.

If you cannot update the library right away, ensure to validate and sanitize all inputs used in parser field names and encoding parameters as a temporary measure.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.3.0

This is the first release that contains the fix.

npm install binary-parser@2.3.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback