{"id":"MAL-2026-12348","summary":"Malicious code in chai-as-rendered (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (545ba2341881e666831e81156a815fdfac738830ec2918167e4c5fd3c42294bf)\nTyposquat of chai-as-promised. The package's exported middleware spawns a detached child process (lib/caller.js) that fetches a JSON payload from a base64-obfuscated jsonstorage.net URL (https://api.jsonstorage.net/v1/json/2ef8c758-a96f-459e-b036-b3b90379a165/f89e8264-86c2-4684-94da-c3f82d59370f) and evaluates the returned.cookie string via new Function.constructor(\"require\", s)(require), giving the fetched code full require access on the installer's host. The remote URL and request headers are stored as base64 strings under fake process.env names (DEV_API_KEY, DEV_SECRET_KEY, DEV_SECRET_VALUE) and decoded with atob() at runtime to conceal the destination. The package name and keywords (fast, logger, stream, json) impersonate pino while the package name typosquats chai-as-promised.\n","modified":"2026-08-05T13:35:02.439863602Z","published":"2026-08-05T12:59:03Z","database_specific":{"malicious-packages-origins":[{"versions":["1.2.0"],"id":"IN-MAL-2026-014834","import_time":"2026-08-05T13:08:50.007717349Z","modified_time":"2026-08-05T12:59:03Z","sha256":"545ba2341881e666831e81156a815fdfac738830ec2918167e4c5fd3c42294bf","source":"amazon-inspector"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-rendered/v/1.2.0"}],"affected":[{"package":{"name":"chai-as-rendered","ecosystem":"npm","purl":"pkg:npm/chai-as-rendered"},"versions":["1.2.0"],"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":[{"sha256":"ffa61701ff61ebc0c6d64cf09f5bc37a74a91b03b716129b90271d758dc164b7","tlsh":"6e01efd934fd501c021111ea171fa032a010e4373882d6c8374cc7428fa66bd2e93aef","path":"lib/caller.js"},{"sha256":"dfe14ad52936fd66e0d9f597459091f41a9f3ba899010bbde7a22f212bc6cd9b","tlsh":"0701c061ce749e7304dd21824c2a0643b6614c435528fd2933d7513d0f9d9bf01bf21d","path":"package.json"}],"package_integrity":[{"filename":"chai-as-rendered-1.2.0.tgz","hashes":{"sha512_sri":"sha512-86s/uZXVv0i1Z2Ty1Uu2eR8ESjvwzF6ixTrhTBAsCDjkYH1Rc88L2tZfmsZvg6pZHuenOgg6GmsXdwKJIEZqqA==","sha1":"9cb07e3ac4d77c8af3ce61f3887de233b0a42103"}}]},"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-rendered/MAL-2026-12348.json"}}],"schema_version":"1.8.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}