Malicious Code Detected in clunit: A Critical npm Package Vulnerability
Summary
MAL-2025-17191: Malicious code in clunit (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 clunit package is a JavaScript testing framework designed for unit testing in Node.js applications. It provides developers with tools to write and execute tests, ensuring code reliability and functionality. However, recent findings have revealed that clunit contains malicious code, posing significant risks to applications that rely on it.
Vulnerability Detail
The vulnerability in the clunit package stems from the inclusion of malicious code that can compromise the security of applications using this package. This code may lead to unauthorized access, data breaches, or other malicious activities. The issue was introduced in version 0 and affects all subsequent versions, making it imperative for users to take immediate action to mitigate risks.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall clunit
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, consider using alternative testing frameworks such as Mocha or Jest until the clunit package is confirmed to be secure. You can install Mocha with the following command: npm install mocha.
Conclusion
The discovery of malicious code in the clunit package poses a significant threat to applications that utilize it. Developers are urged to take immediate action by removing the package and considering alternative testing frameworks. Continuous monitoring for vulnerabilities is essential to maintain application security.
See every vulnerability recorded for clunit →
FAQ
clunit is a JavaScript testing framework for unit testing in Node.js applications, helping developers ensure code quality.
The malicious code was identified through security audits conducted by Amazon Inspector, which monitors open-source packages for vulnerabilities.
Using clunit with the malicious code can lead to unauthorized access, data breaches, and other security vulnerabilities in applications.
Yes, you can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just your package-lock.json file. You can also check your application for vulnerabilities using the Vulert playground.
If you have used clunit, it is crucial to remove it immediately and replace it with a secure alternative. Regularly check for updates and security advisories.