{"id":"MAL-2026-14343","summary":"Malicious code in chai-as-soul (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (244e923b668eb903bcc217cb1eda26ce2227f37bd14abc3699d60c222c4f4e62)\nchai-as-soul@2.3.5 is a typosquat/repackage of pino: LICENSE, README, docs, and lib/ are copied from pinojs/pino, package.json description is unrelated boilerplate, and author metadata does not match pino. The package adds lib/initializeCaller.js, a top-level IIFE that runs on require. It base64-decodes a hardcoded URL (decoding to https://ipcheck-hashed.vercel.app/api/auth/6c1d60d35852ef0c05df) stored in a variable named configEndpoint, then axios.POSTs the installer's entire process.env to that endpoint with an x-secret-header. It then passes the HTTP response body to new Function(\"require\", response.data) and invokes it with require injected, executing attacker-controlled JavaScript in the Node process with full module access. This yields both bulk environment-variable exfiltration (AWS/GCP/CI tokens and any other secrets in env) and arbitrary remote code execution on any host that loads the module.\n","modified":"2026-08-21T04:00:14.657333193Z","published":"2026-08-21T03:48:16Z","database_specific":{"malicious-packages-origins":[{"sha256":"244e923b668eb903bcc217cb1eda26ce2227f37bd14abc3699d60c222c4f4e62","source":"amazon-inspector","versions":["2.3.5"],"id":"IN-MAL-2026-018492","import_time":"2026-08-21T03:50:53.54253319Z","modified_time":"2026-08-21T03:48:26Z"},{"versions":["2.3.6"],"id":"IN-MAL-2026-018491","import_time":"2026-08-21T03:50:53.397242677Z","modified_time":"2026-08-21T03:48:16Z","sha256":"5def06da3e173b5a72193d0c24a914bd00a6ac82f740dc98d7c77a851933ea27","source":"amazon-inspector"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-soul/v/2.3.5"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-soul/v/2.3.6"}],"affected":[{"package":{"name":"chai-as-soul","ecosystem":"npm","purl":"pkg:npm/chai-as-soul"},"versions":["2.3.5","2.3.6"],"database_specific":{"cwes":[{"description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code","cweId":"CWE-506"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"package_integrity":[{"filename":"chai-as-soul-2.3.5.tgz","hashes":{"sha1":"5c743931d1e5a87d252a0818e5345b48412162d2","sha512_sri":"sha512-rOItPYMpzQcg7uo9yhmVoHB34VGSK/4VqPP6drKKa278GqaT+7sH9LI77a/SF745Us5Nkc1Kp7wc9kZFTMV7Gg=="}}],"evidence_files":[{"path":"lib/initializeCaller.js","sha256":"0a22e7a21ac873219d858746d8b32c2e4ba926f598e05fd06a617c792e440f03","tlsh":"dff0e14d24ba2039426e58e2bf1b18461403f9223381d861f7cd936e0f8dc0dea636c8"},{"path":"package.json","sha256":"d30d603e0b9aabd13ca2762f31955d9256df2d4956e752410d9941c345a358f7","tlsh":"36017b20da7c4e2300ed25524c2a0643b6624c175528fd1932db512d0f9d5ff41bf21d"}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-soul/MAL-2026-14343.json"}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}