Skip to main content
MalwarePublished Updated

chai-as-persisted (npm) · Malicious Code

Affects chai-as-persistedSource GCVE Database

0

Malicious package : remove chai-as-persisted and rotate any secrets on hosts that installed it.

Data as of 30 Jun 2026, 23:56 UTC

Classification

Malicious package

Published to npm · OSV MAL-2026-6544

What to do

Remove chai-as-persisted 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

ProductAffectedFixed in
npmchai-as-persistedAffected
  • =4.2.8
  • =6.1.9
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-persisted' is a malicious typosquatting package impersonating the legitimate 'chai-as-promised' package. Its postinstall script executes attacker-controlled JavaScript by decoding a hidden command-and-control URL and running code fetched from it, resulting in remote code execution (RCE) on the installer's machine. The malicious code runs detached from the install process, maintaining persistence beyond installation. Installing this package fully compromises the affected system, risking exposure of all stored secrets and keys.

References

Community reviews

Loading reviews…