Malicious Code Vulnerability in chai-proxy: A Threat to npm Users
Summary
MAL-2026-1684: Malicious code in chai-proxy (npm). Affects chai-proxy versions 2.4.2 – 2.4.3. 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-proxy is an npm package that facilitates the creation of proxy servers for testing and development purposes. It allows developers to intercept and modify HTTP requests and responses, making it a valuable tool for debugging and testing web applications. However, recent findings have revealed that certain versions of chai-proxy contain malicious code, posing significant security risks to users who rely on this package.
Vulnerability Detail
The vulnerability in chai-proxy arises from the inclusion of malicious code in versions 2.4.2 and 2.4.3. This code can potentially compromise the security of applications using the package, leading to unauthorized access, data breaches, or other malicious activities. The origin of this vulnerability is linked to a malicious actor who has injected harmful code into the package, which can execute without the user's knowledge, thus posing a severe threat to application integrity.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chai-proxy
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, users can avoid using the affected versions (2.4.2 and 2.4.3) of chai-proxy until they have updated to a secure version. Additionally, users can implement alternative proxy solutions or manually handle HTTP requests without relying on chai-proxy.
Conclusion
The discovery of malicious code in the chai-proxy package highlights the importance of maintaining vigilance when using open-source software. Users are strongly advised to update to the latest version of the package to mitigate any potential risks associated with this vulnerability. Utilizing tools like Vulert can further enhance security by providing real-time alerts for vulnerabilities in your software.
See every vulnerability recorded for chai-proxy →
FAQ
The affected versions are 2.4.2 and 2.4.3.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.
If immediate updates are not possible, consider using alternative proxy solutions or refrain from using the affected versions until a secure version is available.
Using the affected versions can lead to unauthorized access, data breaches, and other malicious activities that compromise application security.
The vulnerability was identified by ReversingLabs, a cybersecurity firm specializing in threat detection.