Critical Malicious Code Vulnerability in chai-dex Package
Summary
MAL-2026-387: Malicious code in chai-dex (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-dex package is a JavaScript library available through npm, primarily used for enhancing testing capabilities in Node.js applications. It allows developers to write expressive tests using the Chai assertion library. However, the package has been compromised, embedding malicious code that poses significant security risks to any system utilizing it.
Vulnerability Detail
The vulnerability originates from the inclusion of malicious code within the chai-dex package, identified as GHSA-grj8-vvpv-hx8q. Any system running this package is considered fully compromised, potentially allowing attackers to access sensitive information such as secrets and keys stored on the affected machine. The malicious code could lead to unauthorized control over the system, making it imperative for users to act swiftly to mitigate the risks.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chai-dex
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 workaround, users should immediately uninstall the chai-dex package using the command: npm uninstall chai-dex. Additionally, ensure that all sensitive data is rotated and that the system is monitored for any unusual activity.
Conclusion
The chai-dex package has been compromised with malicious code, posing severe security risks to any system using it. Immediate action is required to uninstall the package and rotate any sensitive information. Users are encouraged to utilize tools like Vulert to monitor for vulnerabilities in their applications.
See every vulnerability recorded for chai-dex →
FAQ
Chai-dex is a JavaScript library used in conjunction with the Chai assertion library to enhance testing capabilities in Node.js applications.
If you have the chai-dex package installed, your system is at risk. You can use Vulert's playground to check if your application is affected by this vulnerability.
Immediately rotate all secrets and keys stored on the affected system from a secure environment to prevent unauthorized access.
Currently, there is no patched version available. The best course of action is to uninstall the package and monitor your system for any suspicious activity.
Vulert uses the package-lock.json file to monitor and alert in real-time for open-source vulnerabilities in your software without requiring code access or installation.