chai-as-polished (npm) · Malicious Code
Affects chai-as-polishedSource GCVE Database
Malicious package : remove chai-as-polished and rotate any secrets on hosts that installed it.
Data as of 12 Sep 2026, 20:31 UTC
Malicious package
Published to npm · OSV MAL-2026-5901
What to do
Remove chai-as-polished 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-polished | 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-polished' is a malicious typosquat of the legitimate 'chai-as-promised' package. It contains code that spawns a detached child process which fetches and executes attacker-controlled JavaScript from a remote URL. This allows arbitrary code execution on any system that installs and invokes the package's middleware. The malicious payload is dynamically fetched from an anonymous hosting service, making it fully mutable by the attacker. Systems with this package installed should be considered fully compromised.