Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Malicious package

chai-as-persistednpm

chai-as-persisted is a confirmed malicious npm package (MAL-2026-6544) that opens a backdoor for remote access (malicious versions 4.2.8, 6.1.9). Do not install it — remove it immediately and rotate any exposed credentials.

Malicious code in chai-as-persisted (npm)

MAL-2026-6544
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall chai-as-persisted

What this malware does

The package's postinstall script (npm run smoke:pino) executes index.js, which spawns a detached node lib/initializeCaller.js child. That module hides the C2 URL in base64 strings stored under a fabricated local process.env object (keys DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE) to defeat trivial string scanning. At install time it atob()-decodes the URL to https://www.ipregionchecker.org/api/ip-check-encrypted/3aeb34a37, POSTs to it via axios, and passes the response body to new Function.constructor('require', response), invoking it with require — executing attacker-controlled JavaScript with full Node module access on the installer's machine. The detached child.unref() keeps execution alive after npm install returns. The package name chai-as-persisted is a one-edit impersonation of the widely-used chai-as-promised; the shipped code is unrelated to chai (it pretends to be a pino-style logger middleware in index.js) and the package description/keywords (logger/stream/json) further misrepresent its purpose. This is a deliberate install-time RCE dropper distributed via a typosquat against chai-as-promised.

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.

Malicious versions

2 flagged
4.2.86.1.9

Indicators of compromise (SHA-256)

5cf9c49450e0fa0d47be1b6ae27991f844868ff6c435d2082948b5feae862709
611d869aaf9d1a8b945c83cc9982fd76cd49a26563d444af3cee98ccb5b6fbda
0ace79847a477da41888731730b793f631973178603034abe9016e81caffd10a

Detection & response playbook

Backdoor / remote access
  1. Find it

    Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for chai-as-persisted (2 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging chai-as-persisted across your stack and pipelines.

  2. If you installed it — respond

    chai-as-persisted establishes remote access, so treat any host that installed it as fully compromised. Isolate the machine, remove the package, rotate all credentials it could reach, and rebuild from a trusted image rather than cleaning in place — a backdoor may have planted additional persistence.

  3. Did it already run?

    If chai-as-persisted was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.

  4. How O3 protects you

    O3 blocks chai-as-persisted before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.

Frequently asked questions

No. chai-as-persisted on npm has been identified as a malicious package (versions 4.2.8, 6.1.9 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

IN-MAL-2026-007675IN-MAL-2026-007674GHSA-4wm6-vmww-2544

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks chai-as-persisted-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the C2 callback and severs the channel.

Explore

chai-as-persisted (npm) malicious package — MAL-2026-6544 | O3 Security