Malicious Code Vulnerability in chai-promised-plugin: A Critical Security Risk
Summary
MAL-2026-1682: Malicious code in chai-promised-plugin (npm). Affects chai-promised-plugin versions 2.3.5. 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
chai-promised-plugin is an npm package that extends the Chai assertion library, allowing for the use of promises in assertions. It is designed to enhance testing capabilities in JavaScript applications by providing a more fluent and readable syntax for asynchronous tests. However, the package has been identified to contain malicious code, posing significant security risks to applications that depend on it.
Vulnerability Detail
The vulnerability in chai-promised-plugin stems from the inclusion of malicious code that can compromise the integrity of applications using this package. This issue was reported by ReversingLabs and affects version 2.3.5 of the package. The malicious code can lead to unauthorized access, data breaches, or other harmful actions within the application, making it imperative for developers to address this vulnerability promptly.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chai-promised-plugin
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, you can remove the chai-promised-plugin from your project until a secure version is available. You can do this by executing:
npm uninstall chai-promised-plugin
This will prevent the execution of any malicious code while you seek a safe alternative or wait for an update.
Conclusion
The discovery of malicious code in the chai-promised-plugin package highlights the importance of regularly monitoring and updating dependencies in software projects. Developers should take immediate action to update or remove the affected package to safeguard their applications from potential threats.
See every vulnerability recorded for chai-promised-plugin →
FAQ
chai-promised-plugin is an npm package that enhances the Chai assertion library by allowing for promise-based assertions in JavaScript testing.
The malicious code can lead to unauthorized access and potential data breaches, compromising the security and integrity of your application.
Version 2.3.5 of chai-promised-plugin is known to contain the malicious code.
You can use tools like Vulert, which monitors your package-lock.json file to alert you in real-time for open-source vulnerabilities in your software.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.