Critical Malicious Code Vulnerability in chai-dex Package

chai-dex Updated 21 Jan 2026

Summary

21/01/2026
CRITICAL
No i
Critical
Not published

MAL-2026-387: Malicious code in chai-dex (npm). Affected versions are not published. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The chai-dex package is a JavaScript library available through npm, primarily used for enhancing testing capabilities in Node.js applications. It allows developers to write expressive tests using the Chai assertion library. However, the package has been compromised, embedding malicious code that poses significant security risks to any system utilizing it.

Vulnerability Detail

The vulnerability originates from the inclusion of malicious code within the chai-dex package, identified as GHSA-grj8-vvpv-hx8q. Any system running this package is considered fully compromised, potentially allowing attackers to access sensitive information such as secrets and keys stored on the affected machine. The malicious code could lead to unauthorized control over the system, making it imperative for users to act swiftly to mitigate the risks.

How To Fix

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

npm uninstall chai-dex

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 workaround, users should immediately uninstall the chai-dex package using the command: npm uninstall chai-dex. Additionally, ensure that all sensitive data is rotated and that the system is monitored for any unusual activity.

Conclusion

The chai-dex package has been compromised with malicious code, posing severe security risks to any system using it. Immediate action is required to uninstall the package and rotate any sensitive information. Users are encouraged to utilize tools like Vulert to monitor for vulnerabilities in their applications.

See every vulnerability recorded for chai-dex →

Share this vulnerability

FAQ

Chai-dex is a JavaScript library used in conjunction with the Chai assertion library to enhance testing capabilities in Node.js applications.

If you have the chai-dex package installed, your system is at risk. You can use Vulert's playground to check if your application is affected by this vulnerability.

Immediately rotate all secrets and keys stored on the affected system from a secure environment to prevent unauthorized access.

Currently, there is no patched version available. The best course of action is to uninstall the package and monitor your system for any suspicious activity.

Vulert uses the package-lock.json file to monitor and alert in real-time for open-source vulnerabilities in your software without requiring code access or installation.

How To Fix

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

npm uninstall chai-dex

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