Critical Malicious Code Vulnerability in chai-async-chains Package
Summary
MAL-2025-192753: Malicious code in chai-async-chains (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-async-chains package is an npm library designed to enhance the Chai assertion library by providing asynchronous chaining capabilities. It allows developers to write more readable and maintainable tests by enabling a fluent interface for assertions. However, this package has been found to contain malicious code that compromises the security of any system where it is installed.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the chai-async-chains package. This code can fully compromise any computer that has the package installed, potentially allowing unauthorized access to sensitive information such as secrets and keys. The malicious nature of the code means that simply removing the package may not eliminate all traces of the compromise, as it could have facilitated the installation of additional malicious software.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chai-async-chains
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 chai-async-chains package. The only recommended action is to uninstall the package and replace it with a secure alternative for asynchronous assertions in your testing framework.
Conclusion
The discovery of malicious code in the chai-async-chains package poses a significant security risk to systems that utilize it. Immediate action is required to uninstall the package and secure any exposed information. Continuous monitoring for vulnerabilities is essential to maintain the integrity of your software.
See every vulnerability recorded for chai-async-chains →
FAQ
Chai-async-chains is an npm library that extends the Chai assertion library to support asynchronous chaining, making tests more readable.
The malicious code can compromise your system, allowing unauthorized access to sensitive information and potentially leading to further security breaches.
You should uninstall the chai-async-chains package immediately and rotate any sensitive information that may have been exposed.
No, there is currently no patched version of the chai-async-chains package available. It is recommended to avoid using it altogether.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just your package-lock.json file. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.