OpenSSF/OSV advisory MAL-2026-6544 confirms this npm version as malicious. 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...
Source
OpenSSF Malicious Packages via OSV
Summary
Malicious code in chai-as-persisted (npm)
Details
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.
## Source: ghsa-malware (0ace79847a477da41888731730b793f631973178603034abe9016e81caffd10a) 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.
Decision reason
OpenSSF Malicious Packages via OSV confirms chai-as-persisted@4.2.8 as malicious (MAL-2026-6544): Malicious code in chai-as-persisted (npm)