Malicious Code Vulnerability in chai-as-tested: npm Package Compromised

chai-as-tested Updated 23 Dec 2025

Summary

23/12/2025
CRITICAL
No i
Critical
Not published

MAL-2025-192723: Malicious code in chai-as-tested (npm). Affects chai-as-tested versions 2.3.8. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

chai-as-tested is a popular npm package that extends the Chai assertion library, allowing developers to write tests in a more expressive manner. It is widely used in JavaScript testing environments to facilitate behavior-driven development (BDD). However, recent findings have revealed that this package has been compromised, introducing malicious code that could potentially harm applications relying on it.

Vulnerability Detail

The vulnerability identified in chai-as-tested is characterized by the presence of malicious code that can execute unauthorized actions within the user's environment. This issue originated from a compromised version of the package, specifically version 2.3.8, which was identified by ReversingLabs. The ramifications of this vulnerability include potential data breaches, unauthorized access to sensitive information, and the risk of further exploitation by attackers. Developers using this package are urged to take immediate action to mitigate these risks.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall chai-as-tested

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-as-tested package from your project until a secure version is released. You can do this by running the following command: npm uninstall chai-as-tested. Alternatively, consider using a different assertion library that does not have known vulnerabilities.

Conclusion

The discovery of malicious code in the chai-as-tested npm package poses significant risks to developers and their applications. Immediate action is required to update or remove the affected package to safeguard against potential exploitation. Utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.

See every vulnerability recorded for chai-as-tested →

Share this vulnerability

FAQ

chai-as-tested is an npm package that extends the Chai assertion library, enabling developers to write expressive tests for JavaScript applications.

The vulnerability was discovered by ReversingLabs, which identified malicious code in version 2.3.8 of the chai-as-tested package.

The risks include unauthorized access to sensitive data, potential data breaches, and the possibility of further exploitation by malicious actors.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By utilizing the Vulert playground, you can check if your application is affected without any signup.

If immediate updates are not feasible, consider removing the package or using an alternative library until a secure version is available.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall chai-as-tested

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback