Critical Malicious Code Vulnerability in chai-as-advanced Package
Summary
MAL-2026-764: Malicious code in chai-as-advanced (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-as-advanced package is a JavaScript library used in Node.js applications for advanced assertions in testing. It enhances the capabilities of the Chai assertion library, allowing developers to write more expressive and readable tests. However, this package has been found to contain malicious code that compromises the security of any system using it.
Vulnerability Detail
The vulnerability originates from the inclusion of malicious code within the chai-as-advanced package. This code can lead to a complete compromise of any computer where the package is installed, allowing unauthorized access to sensitive information such as secrets and keys. The malicious nature of the code has been confirmed by multiple sources, indicating that systems running this package should be considered fully compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chai-as-advanced
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
There are no effective workarounds for this vulnerability other than removing the package and ensuring that all sensitive information is secured. You can remove the package using the following command: npm uninstall chai-as-advanced.
Conclusion
The discovery of malicious code within the chai-as-advanced package poses a significant security risk to any system utilizing it. Immediate action is required to remove the package and secure sensitive information. Regular monitoring for vulnerabilities is essential to maintain the integrity of your applications.
See every vulnerability recorded for chai-as-advanced →
FAQ
Chai-as-advanced is a JavaScript library that extends the Chai assertion library, providing advanced assertion capabilities for testing in Node.js applications.
The malicious code can compromise your system, allowing unauthorized access to sensitive data and potentially leading to further exploitation.
Immediately uninstall the chai-as-advanced package and rotate any secrets or keys stored on the affected system.
As of now, there is no patched version available. It is recommended to remove the package entirely.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software using just the package-lock.json file. You can also check if your application is affected by this vulnerability using the Vulert playground without any signup.