Critical Malicious Code Vulnerability in chai-nerd Package
Summary
MAL-2025-192624: Malicious code in chai-nerd (npm). Affected versions are not published. 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 chai-nerd package is an npm library designed for enhancing testing capabilities in JavaScript applications. It provides various utilities and assertions to facilitate the development of robust test cases. However, this package has been compromised, leading to severe security implications for any system utilizing it.
Vulnerability Detail
The vulnerability originates from the presence of malicious code embedded within the chai-nerd package. This code can fully compromise any computer where the package is installed, allowing unauthorized access to sensitive information such as secrets and keys. Users are advised to treat any system with this package as compromised, as the malicious code may persist even after removal of the package.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chai-nerd
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 malicious code in the chai-nerd package. The only recommended action is to remove the package entirely.
Conclusion
The chai-nerd package has been identified as containing malicious code that poses a significant security risk. Immediate action is required to remove the package and secure any potentially compromised information. Utilizing tools like Vulert can help in monitoring and managing open-source vulnerabilities effectively.
See every vulnerability recorded for chai-nerd →
FAQ
Immediately remove the chai-nerd package from your project and rotate any sensitive information that may have been compromised.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.
Failing to address this vulnerability can lead to unauthorized access to your system, data breaches, and potential exploitation of sensitive information.
Regularly monitor your dependencies for vulnerabilities using tools like Vulert, which can alert you in real-time for open-source vulnerabilities.
Detailed information can be found in the vulnerability report on GitHub or through security advisories related to the chai-nerd package.