Critical Malicious Code Vulnerability in token.js-fork Package
Summary
MAL-2025-190785: Malicious code in token.js-fork (npm). Affects token.js-fork versions 0.7.32. 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 token.js-fork package is a JavaScript library commonly used in Node.js applications for handling token generation and management. It is designed to simplify the process of creating and validating tokens, making it a popular choice among developers. However, this package has been identified as containing malicious code, which poses significant security risks to any system utilizing it.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the token.js-fork package, specifically version 0.7.32. This code can compromise the entire system where the package is installed, allowing unauthorized access to sensitive information such as secrets and keys. The malicious nature of this code means that any system running this package should be considered fully compromised, with potential ramifications including data theft and unauthorized control over the affected system.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall token.js-fork
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
Currently, there are no effective workarounds to mitigate the risks associated with the token.js-fork package. The only recommended action is to uninstall the package entirely.
Conclusion
The token.js-fork package has been identified as containing malicious code that poses a serious security threat. Immediate action is required to uninstall the package and secure any sensitive information. Regular monitoring for vulnerabilities using tools like Vulert is recommended to maintain the security of your applications.
See every vulnerability recorded for token.js-fork →
FAQ
token.js-fork is a JavaScript library used for token generation and management in Node.js applications.
The malicious code can compromise your entire system, allowing unauthorized access to sensitive information and potentially leading to data theft.
There is currently no patched version of the token.js-fork package available. The only solution is to uninstall the package.
After uninstalling the token.js-fork package, you should rotate all secrets and keys stored on the affected system from a secure machine.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities in your software. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.