{"id":"MAL-2026-10047","revision":"006848c49e5e430f90b65e5b8dbff1bd","records":[{"revision":"006848c49e5e430f90b65e5b8dbff1bd","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"MAL-2026-10047","aliases":["GHSA-fchw-g3j3-hxh3"],"title":"Malicious code in chai-as-staged (npm)","description":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (84d908f9158abcdd631b569f812b06cb59a1788f2435dd05a47fd39021d60a49)\nPackage name impersonates the popular `chai-as-promised` testing library and the README is copied from `pino`. The advertised usage `chai.use(chaiAsStaged)` triggers a detached `node` child process that runs `lib/initializeCaller.js`. That file hides its C2 endpoint and a custom HTTP header name/value as base64 strings stored under decoy names (`DEV_API_KEY`, `DEV_SECRET_KEY`, `DEV_SECRET_VALUE`) inside a fake local `process` object; at runtime it base64-decodes the URL to `https://amethyst-lorrin-26.tiiny.site/index.json`, fetches it with the obfuscated header, extracts the `.cookie` field from the JSON response, and executes the returned JavaScript via `new Function.constructor('require', response)(require)` in a retry loop. Attacker-controlled code is therefore executed on the installer's machine with full `require` access whenever the library is used as documented. The combination of name/README impersonation, base64-obfuscated C2 on an anonymous static-hosting host, and dynamic code construction with `require` removes any benign interpretation.\n","state":0,"publishedAt":"2026-07-09T15:34:00+00:00","modifiedAt":"2026-09-01T11:31:29.5489075+00:00","affected":[{"ecosystem":"npm","name":"chai-as-staged","ranges":[],"versions":["6.0.4"],"rawVersionEvidence":null}],"metrics":[],"references":["https://www.npmjs.com/package/chai-as-staged/v/6.0.4","https://github.com/advisories/GHSA-fchw-g3j3-hxh3"],"sourceUrl":"https://osv.dev/vulnerability/MAL-2026-10047","license":"OSV · upstream source license applies","key":"osv:MAL-2026-10047","identifiers":["MAL-2026-10047","GHSA-fchw-g3j3-hxh3"]},"retained":false,"historicalAffected":[]}],"coverage":[]}