{"id":"MAL-2026-6218","summary":"Malicious code in chai-as-attested (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (88e27467366a90f482eb47476458b1f74d5a41ac63371572e527f2e60e4e0b51)\nPackage impersonates a pino-style logger (exports `module.exports.pino`, ships pino-like `DEFAULT_LEVELS`, keywords `fast/logger/stream/json`) but the exported middleware spawns a detached `node lib/initializeCaller.js` that fetches a JSON document from a hardcoded free file-hosting URL (https://amethyst-lorrin-26.tiiny.site/index.json) and executes the `cookie` field of the response via `new Function.constructor('require', response)(require)`, granting the remote payload full Node `require` access. The endpoint URL and request headers are base64-encoded inside fake `process.env`-named constants and decoded at runtime with `atob` to evade scanners; the fetch is retried 5 times. Any consumer who imports the package and invokes the middleware (or runs the package's smoke script) executes attacker-controlled code on the host. The package name and pino-mimicking API surface are a lure — `chai-as-attested` has no relation to chai-as-promised or to pino.\n\n## Source: ghsa-malware (bb6756ece7eb10964628eea76db45ccc30a5d6b3fc01cccaafa48bce6c65d6ac)\nAny 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.\n","aliases":["GHSA-v8fp-q6g9-vj9c"],"modified":"2026-06-23T13:32:39.472630395Z","published":"2026-06-19T15:00:12Z","database_specific":{"malicious-packages-origins":[{"sha256":"88e27467366a90f482eb47476458b1f74d5a41ac63371572e527f2e60e4e0b51","import_time":"2026-06-19T15:41:55.286171535Z","id":"IN-MAL-2026-007072","modified_time":"2026-06-19T15:00:12Z","versions":["6.0.3"],"source":"amazon-inspector"},{"sha256":"bb6756ece7eb10964628eea76db45ccc30a5d6b3fc01cccaafa48bce6c65d6ac","import_time":"2026-06-23T13:16:55.915230305Z","id":"GHSA-v8fp-q6g9-vj9c","modified_time":"2026-06-23T11:26:41Z","ranges":[{"events":[{"introduced":"0"}],"type":"SEMVER"}],"source":"ghsa-malware"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-attested/v/6.0.3"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-v8fp-q6g9-vj9c"}],"affected":[{"package":{"name":"chai-as-attested","ecosystem":"npm","purl":"pkg:npm/chai-as-attested"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["6.0.3"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"package_integrity":[{"filename":"chai-as-attested-6.0.3.tgz","hashes":{"sha1":"6062fcd92a50e5e01ea2155aee1f972f75964547","sha512_sri":"sha512-TOpABde1f4vP3sWDQtQggQiLDExJspmu2YxIg/Vm9zAZViy4+EzSO9pM0tVLyvTn4rIs9+GWQskmnO/CjvdMdg=="}}],"evidence_files":[{"tlsh":"f111008d61fc200c056512e6b22f18116022e4273d4ad4e47adc83470f9627fbd536df","path":"lib/initializeCaller.js","sha256":"2a41c6b7c5e256d70f884c613c6412ef73d86f8cd8a65afe6afb64fabaf4e022"},{"path":"package.json","sha256":"d31a4dfa7836b9e53773cd31bf1a91be67cac8e3b50a5a7ea2d7b871cfe882e7","tlsh":"22019c60ce788e2300ed25824c2a0643b6619c135928fc1932db512c0f9d5bf11ff21e"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-attested/MAL-2026-6218.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}