chai-deflect (npm) · Malicious Code
Affects chai-deflectSource GCVE Database
Malicious package : remove chai-deflect and rotate any secrets on hosts that installed it.
Data as of 12 Sep 2026, 19:31 UTC
Malicious package
Published to npm · OSV MAL-2026-10051
What to do
Remove chai-deflect 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-deflect | 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-deflect contains malicious code that executes arbitrary code on any host importing the module. It does so by launching a detached child process that fetches a payload from a remote server via an HTTP GET request. If the server responds with a 404 status containing a token field, the response body is executed dynamically using new Function, enabling remote code execution. The package masquerades as a Chai assertion plugin but includes unrelated filler code and hides a secondary URL in a base64-encoded constant. This behavior classifies it as a remote-loader dropper with critical impact.