Malicious Code Injection in json-bigint-rs Package
Summary
MAL-2026-17312: Malicious code in json-bigint-rs (npm). Affects json-bigint-rs versions 0.1.1. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The json-bigint-rs package is an npm library designed to parse JSON data with support for big integers. It is intended for use in JavaScript environments where large numbers need to be accurately represented. However, this package has been found to contain malicious code that can execute arbitrary JavaScript in the context of the application, posing significant security risks.
Vulnerability Detail
The vulnerability originates from the json-bigint-rs package, specifically in the index.js file, which instantiates a WebAssembly (WASM) module. This module exposes JavaScript payloads as import-descriptor names, allowing malicious code to be executed without detection by standard JavaScript scanners. The payload is an Immediately Invoked Function Expression (IIFE) that polls three hardcoded remote hosts every 30 seconds and executes the received JavaScript code, which can lead to unauthorized access and control over the application. The execution is conditional on the NODE_ENV variable being set to 'production', meaning it remains dormant in development environments, making it particularly insidious.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall json-bigint-rs
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, you can remove the json-bigint-rs package from your project if it is not essential. Alternatively, consider using a different package for JSON parsing that does not have known vulnerabilities.
Conclusion
The json-bigint-rs package contains a serious vulnerability that allows for the execution of malicious code. It is crucial for developers using this package to take immediate action by updating or removing it to protect their applications from potential attacks.
See every vulnerability recorded for json-bigint-rs →
FAQ
The json-bigint-rs package is used for parsing JSON data while accurately handling big integers in JavaScript applications.
The malicious code operates by fetching and executing JavaScript from remote hosts, which can compromise the security of the application.
If you are using json-bigint-rs, you should update to the latest version or remove the package from your project to mitigate the risk.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just the package-lock.json file.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.