chai-as-modified (npm) · Malicious Code
Affects chai-as-modifiedSource GCVE Database
Malicious package : remove chai-as-modified and rotate any secrets on hosts that installed it.
Data as of 12 Sep 2026, 19:16 UTC
Malicious package
Published to npm · OSV MAL-2026-10043
What to do
Remove chai-as-modified from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmchai-as-modified | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The npm package 'chai-as-modified' is a malicious variant of the legitimate 'chai-as-promised' plugin. It attempts to execute out-of-band code by spawning a detached Node.js subprocess running a hidden script, which is not related to its advertised functionality. The package includes decoy content copied from an unrelated project to mislead users. The actual payload script is missing in the current version, causing the subprocess to error out, suggesting a possible staged or subsequent payload delivery. This behavior poses a high risk due to covert execution capabilities.