{"id":"MAL-2026-10039","summary":"Malicious code in chai-as-align (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (791f5dcd4f623d5301bc3abf922c5f0e4ff716017fe67d3673c778e9d31b0776)\nThe package presents itself as a testing/logging helper but its exported middleware factory spawns a detached background Node child that runs lib/initializeCaller.js. That script base64-decodes a hidden URL (https://amethyst-lorrin-26.tiiny.site/index.json) from a fake process.env stub, fetches its 'cookie' field over HTTPS with an 'x-secret-key' header, and executes the returned body via `new Function.constructor('require', response)` bound to the real `require`, in a retry loop. This yields full remote code execution on the installer's machine whenever the exported middleware is invoked. The destination is an anonymous file-hosting service (tiiny.site) whose contents are attacker-mutable. The package name closely resembles the popular chai-as-promised library, and its declared description/keywords do not match the shipped code, indicating typosquat delivery of the dropper. The detached+unref'd child with stdio ignored is used to hide the payload's activity from the consuming application.\n","aliases":["GHSA-8vcr-xf6w-wg45"],"modified":"2026-09-01T11:30:50.076730169Z","published":"2026-07-09T15:33:32Z","database_specific":{"malicious-packages-origins":[{"versions":["7.1.0"],"id":"IN-MAL-2026-009136","import_time":"2026-07-09T16:20:44.287628876Z","modified_time":"2026-07-09T15:33:32Z","sha256":"791f5dcd4f623d5301bc3abf922c5f0e4ff716017fe67d3673c778e9d31b0776","source":"amazon-inspector"},{"sha256":"68e0cd5dd9417808ac7e6442656f3fd723ae6d94ad8666d473872abfbb3e099d","source":"reversing-labs","versions":["7.1.0"],"id":"RLMA-2026-06107","import_time":"2026-09-01T11:17:27.490409335Z","modified_time":"2026-08-24T16:43:11Z"}]},"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-align/v/7.1.0"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-8vcr-xf6w-wg45"}],"affected":[{"package":{"name":"chai-as-align","ecosystem":"npm","purl":"pkg:npm/chai-as-align"},"versions":["7.1.0"],"database_specific":{"source":"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/chai-as-align/MAL-2026-10039.json","cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"sha256":"2a41c6b7c5e256d70f884c613c6412ef73d86f8cd8a65afe6afb64fabaf4e022","tlsh":"f111008d61fc200c056512e6b22f18116022e4273d4ad4e47adc83470f9627fbd536df","path":"lib/initializeCaller.js"},{"tlsh":"0e016860ce788e2304ed2582582a064376618c175928fc1932d7512c0f9d4bf05be21d","path":"package.json","sha256":"1d347da8cf0c0f7c8f3070a1bd311adb3a6ae9c9604be1d5a2296f3b10060828"},{"path":"index.js","sha256":"1f51184c197102444a2c8a23e4a8e54a6479750420512922fcb5d5f795c33911","tlsh":"0f318545b5f21259126d98c4f6b4a5263cdf9437331b76b1cded93952bce2080032bc7"}],"package_integrity":[{"filename":"chai-as-align-7.1.0.tgz","hashes":{"sha1":"876e7d2c6ac31cec86a29b7c833b9d938466ae48","sha512_sri":"sha512-EJ6J27HNFs/eID75yCGdKWBhgOL8pEKuK2ZPJLoLKtyyabZCbw4Cqlpd57jEdpoK1nlZ0pVKPqeNxNj7F429vg=="}}]}}}],"schema_version":"1.9.0","credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"},{"name":"ReversingLabs","contact":["https://www.reversinglabs.com"],"type":"FINDER"}]}