{"id":"MAL-2026-10621","summary":"Malicious code in chai-as-hardened (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (20c6afe564cf46f02258e635c1b08a802cd4f9b949e098710f44544cdbb86dfd)\nOn require, index.js spawns a detached Node child process running lib/initializeCaller.js. That script base64-decodes a hardcoded URL (tomato-brunhilda-40.tiiny.site/index.json) via atob, fetches the response with axios, and executes the response body through the Function constructor with `require` injected, granting the remote payload full Node capabilities on the installer's machine. The destination URL and request header are stored as base64 strings in a shadowed local `process.env` object to hide the target from static review. Package metadata is a cover story: the name resembles chai-as-promised, the description references vulnerability management, and exports mimic pino (module.exports.pino = middleware) with keywords 'logger', 'stream', 'json' to attract developers into installing and requiring it, at which point the remote-execution chain fires.\n","modified":"2026-07-14T21:04:39.632069128Z","published":"2026-07-14T20:33:37Z","database_specific":{"malicious-packages-origins":[{"source":"amazon-inspector","versions":["7.0.9"],"id":"IN-MAL-2026-010565","import_time":"2026-07-14T20:52:50.166593978Z","modified_time":"2026-07-14T20:33:37Z","sha256":"20c6afe564cf46f02258e635c1b08a802cd4f9b949e098710f44544cdbb86dfd"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-hardened/v/7.0.9"}],"affected":[{"package":{"name":"chai-as-hardened","ecosystem":"npm","purl":"pkg:npm/chai-as-hardened"},"versions":["7.0.9"],"database_specific":{"cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}],"indicators":{"evidence_files":[{"path":"lib/initializeCaller.js","sha256":"23436f977c9bbe6d302f0f94e191b3dfd938e5a0417ec098d38b60b0ed0cb14f","tlsh":"9511c08e61fc200c046512e6b62f18126021e8673d86d5e47acc835b1f9567f7d936df"},{"path":"package.json","sha256":"268ea0d85025358badbfd13a73ac39158b2ed87d034cdee89cc9d81ef195120d","tlsh":"f5019c20ce788e2300ed25824c2a0643b6718c135928fc1932d7512c0f9d5bf05bf21d"}],"package_integrity":[{"filename":"chai-as-hardened-7.0.9.tgz","hashes":{"sha512_sri":"sha512-C7V9ZEAl1DcziuiIwEuHYiDCFKB8qVWiAQ6gYQaFigSChPsHyz7E84mU94nQq3oi79Rx7e1/jvJBqK46/S6K2g==","sha1":"eed49d4dfce8a1fa69014ecc0cb92323f82ab91c"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-hardened/MAL-2026-10621.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}