Skip to main content
MalwarePublished Updated

chai-as-decrypted (npm) · Malicious Code

Affects chai-as-decryptedSource GCVE Database

0

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

Data as of 7 Jul 2026, 12:28 UTC

Classification

Malicious package

Published to npm · OSV MAL-2026-5900

What to do

Remove chai-as-decrypted 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-decryptedAffected
  • =4.2.8
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (3ed93b06c95c42e3183b89e5fb1d9dea3f711bb20d766861c8d16b8d17f17cc9) Package name `chai-as-decrypted` mimics the popular `chai-as-promised`, and the README impersonates `pino` (uses pino's npm badges and links to github.com/pinojs/pino). On `npm install`, the `postinstall` hook runs `npm run smoke:pino` → `node./index.js`, whose top-level `runBackgroundTask()` spawns a detached `node lib/initializeCaller.js`. That file shadows the global `process` with a local object whose `env.DEV_API_KEY` is a base64 string; it `atob`-decodes the value to https://www.ipregionchecker.org/api/ip-check-encrypted/3aeb34a37, POSTs to it via axios, and executes the HTTP response body with `new Function.constructor("require", response)(require)` — arbitrary remote JavaScript run with full `require` access on the installer's machine, retried 5 times. The base64 hiding of the endpoint and headers behind a fake `process.env` has no legitimate purpose and is solely to evade static scanners. This is a deliberate install-time remote code execution attack against developers who mistype `chai-as-promised`. ## Source: ghsa-malware (4247d01c68df5aa81cfd5bf2bec45101bd522f079f6c9ca5289e7541fc53e198) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

References

Community reviews

Loading reviews…