Malicious Code Vulnerability in chai-as-prop: A Critical Security Concern

chai-as-prop Updated 19 Mar 2026

Summary

18/03/2026
CRITICAL
No i
Critical
Not published

MAL-2026-1670: Malicious code in chai-as-prop (npm). Affects chai-as-prop versions 5.1.7. 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-prop is an npm package that extends the Chai assertion library, allowing developers to assert properties of objects in a more intuitive manner. It is widely used in testing JavaScript applications, providing a simple and effective way to validate object properties. However, this package has been found to contain malicious code, posing a significant risk to applications that rely on it.

Vulnerability Detail

The vulnerability in chai-as-prop stems from the introduction of malicious code that can compromise the integrity of applications using this package. This code could potentially allow unauthorized access to sensitive data, execute arbitrary commands, or manipulate application behavior. The malicious code was identified in version 5.1.7 of the package, and it is crucial for developers to be aware of the risks associated with using this compromised version.

How To Fix

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

npm uninstall chai-as-prop

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

If you are unable to update the package immediately, consider removing chai-as-prop from your project and replacing it with an alternative assertion library that does not have known vulnerabilities. Additionally, you can monitor your dependencies for vulnerabilities using tools like Vulert, which can alert you to any issues in real-time.

Conclusion

The discovery of malicious code in the chai-as-prop package highlights the importance of maintaining secure dependencies in software development. Developers should take immediate action to update or replace the affected package to safeguard their applications from potential threats.

See every vulnerability recorded for chai-as-prop →

Share this vulnerability

FAQ

chai-as-prop is an npm package that extends the Chai assertion library, allowing for more intuitive property assertions in JavaScript testing.

The malicious code can compromise application integrity, potentially allowing unauthorized access to sensitive data or executing arbitrary commands.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

Consider removing chai-as-prop from your project and using an alternative assertion library. Additionally, monitor your dependencies for vulnerabilities using tools like Vulert.

Using Vulert, you can monitor and receive alerts for open-source vulnerabilities in your software in real-time, ensuring you are always informed.

How To Fix

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

npm uninstall chai-as-prop

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