{"id":"MAL-2026-10042","summary":"Malicious code in chai-as-disarmed (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (b6d396201a3dd1706d97f7daa880f254c920bbea65ea6b013ed48f78a21a0241)\nPackage name typosquats `chai-as-promised` while the README and keywords impersonate `pino` to bait installs. On `require()`, index.js detach-spawns `lib/caller.js`, which decodes a base64-stored URL to `https://api.jsonstorage.net/v1/json/2ef8c758-.../a179ea35-...`, issues an authenticated GET (header name and value are also base64-hidden inside a local object that shadows `process.env`), and executes the returned `.cookie` string via `new Function.constructor('require', s)(require)` — granting the remote operator arbitrary code execution in the installer's Node.js process with full `require` access. The fetch retries up to 5 times. The remote content sits in a mutable third-party JSON store, so the executed payload can be swapped at any time without republishing the package. None of this behavior corresponds to the advertised chai/pino functionality.\n","modified":"2026-07-09T16:31:53.092904889Z","published":"2026-07-09T15:31:23Z","database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","versions":["3.2.3"],"id":"IN-MAL-2026-009121","import_time":"2026-07-09T16:20:42.678266948Z","modified_time":"2026-07-09T15:31:23Z","sha256":"b6d396201a3dd1706d97f7daa880f254c920bbea65ea6b013ed48f78a21a0241"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-disarmed/v/3.2.3"}],"affected":[{"package":{"name":"chai-as-disarmed","ecosystem":"npm","purl":"pkg:npm/chai-as-disarmed"},"versions":["3.2.3"],"database_specific":{"cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"package_integrity":[{"filename":"chai-as-disarmed-3.2.3.tgz","hashes":{"sha1":"f4060088659f36923da72cc961b9b6a010efbddb","sha512_sri":"sha512-aKndTvFWthsrdVdfZyGowK/BJ7U8Ku9nsfk1T+6tGJWyESLQ/H6IKOAahfkW8OEjB1Fs7lnBprvzBM29b2jOFQ=="}}],"evidence_files":[{"tlsh":"3b01cb61ceb88e6301dd21828c2e4643b6618c539928fd2932d7522c0f9e9bf11bf21d","path":"package.json","sha256":"4e8193c9bbf3102012bb1e9575e8296fac350d5af1441c97570f3b988c8daaf2"},{"path":"lib/caller.js","sha256":"6c87c9848b319c905ed8db467c1b8535c83c4afed4391d6df3b2c0c0f3de76e2","tlsh":"b501c29934fe501c015111e9171fb1326050e4773986d6c8374c87029fa667e6e93adf"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-disarmed/MAL-2026-10042.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}