{"id":"MAL-2026-16307","summary":"Malicious code in chai-testing (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (da6bebc82e500e38b0ab9c507b1d56c18a05a1ffd04fcee60f0dcad991c8944a)\nThe package's main entry (index.js) spawns a detached `node lib/caller.js` when the module is required. caller.js base64-decodes a hardcoded URL (https://ipcheck-hashed.vercel.app/api/auth/...) stored in a fake `process.env.DEV_API_KEY` constant, POSTs to that endpoint via axios, and executes the returned body by constructing a Function and invoking it with Node's `require`. The endpoint and header values are base64-encoded and decoded with atob at runtime to hide the destination from review. The package name and README metadata mimic legitimate chai/pino testing and logging libraries, but the shipped code is unrelated to any advertised functionality. Requiring the module — including via the exported middleware, which invokes the dropper as a side effect — triggers execution of attacker-controlled JavaScript with full Node privileges on the installer's host.\n","modified":"2026-09-21T03:30:17.631935727Z","published":"2026-09-21T03:20:32Z","database_specific":{"malicious-packages-origins":[{"sha256":"da6bebc82e500e38b0ab9c507b1d56c18a05a1ffd04fcee60f0dcad991c8944a","source":"amazon-inspector","versions":["1.1.4"],"id":"IN-MAL-2026-020205","import_time":"2026-09-21T03:24:21.201468408Z","modified_time":"2026-09-21T03:20:32Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-testing/v/1.1.4"}],"affected":[{"package":{"name":"chai-testing","ecosystem":"npm","purl":"pkg:npm/chai-testing"},"versions":["1.1.4"],"database_specific":{"indicators":{"evidence_files":[{"path":"lib/caller.js","sha256":"bc5103643540917e994c3daa22faaee3701ab634a10bd4383e856b72cdba283f","tlsh":"d601b88960fd141c016622e5272fa4326450e86b394ad9d4374cc3424fae6be7aa3bdf"},{"path":"package.json","sha256":"abb46d4d95c16dc8ddfdbcd2d31da457ac3a1eccb2428e76acab6eac03e8ec1c","tlsh":"1301cb61ceb48e2301dd21925c2e0243b6718c439928fc2d32d7522d4fad9bf01bf21d"}],"package_integrity":[{"hashes":{"sha512_sri":"sha512-BjwzhMHBLMBApcQvD5zfUdYAu2W1yhLd0n2dGU4qFZ/+h8U9ZE4MDik5YIFJn8d3YZjh7QOkPNnAOXzUUkKvAQ==","sha1":"b7f72300d4e54d2cfa10cf1a58a5ea01117a1e1b"},"filename":"chai-testing-1.1.4.tgz"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-testing/MAL-2026-16307.json","cwes":[{"name":"Embedded Malicious Code","cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature."}]}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}