{"id":"MAL-2026-10518","summary":"Malicious code in chai-as-auth (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (12dffbf180eff9ea18e21c9fc8c514912e95e40b3439fc43c3e3124b7ed189a3)\nlib/initializeCaller.js contains a self-executing IIFE that POSTs the entire process.env object to a hardcoded remote endpoint and then executes the HTTP response body via new Function(\"require\", response.data)(require). The destination URL is base64-encoded and stashed on a fake local `process.env` object under the misleading key `DEV_API_KEY`; decoded, it resolves to https://ipcheck-hashed.vercel.app/api/auth/6c1d60d35852ef0c05df. The package name mimics legitimate authentication libraries while the shipped code is a repackaged pino tree combined with the stealer module. On require, environment variables (which routinely include AWS/GCP tokens, CI secrets, npm tokens, and database credentials) are shipped off-host and the remote server is handed arbitrary Node.js code execution with full `require` access for follow-on payloads.\n","modified":"2026-07-14T03:16:56.443518236Z","published":"2026-07-14T02:29:39Z","database_specific":{"malicious-packages-origins":[{"modified_time":"2026-07-14T02:29:39Z","sha256":"12dffbf180eff9ea18e21c9fc8c514912e95e40b3439fc43c3e3124b7ed189a3","source":"amazon-inspector","versions":["2.3.5"],"id":"IN-MAL-2026-010357","import_time":"2026-07-14T03:07:05.532816728Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-auth/v/2.3.5"}],"affected":[{"package":{"name":"chai-as-auth","ecosystem":"npm","purl":"pkg:npm/chai-as-auth"},"versions":["2.3.5"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"}],"indicators":{"evidence_files":[{"tlsh":"f921f38e15fe101d066751e6bb2f24027022e8133946d4a47bcc835b1fc966e99936df","path":"lib/initializeCaller.js","sha256":"fc61b0ed62e346bfbb5e1e093e475d8b3065247dc8d315f0ea4e7cafd9661bad"}],"package_integrity":[{"filename":"chai-as-auth-2.3.5.tgz","hashes":{"sha1":"66ce1b0978c4b37ed574b4332745ea3d3c90ab87","sha512_sri":"sha512-ahOg19+NLbwrJJ6icorbh/C7Npq8TJ6z1lmdQNppX8cqApCVLgZAFijjgPFW0vZBP3f9l01N45MuDm4sjnBIqg=="}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-auth/MAL-2026-10518.json"}}],"schema_version":"1.7.5","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}