{"id":"MAL-2026-2740","revision":"d69ba21b83984b7487a75495c1f0396c","records":[{"revision":"d69ba21b83984b7487a75495c1f0396c","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"MAL-2026-2740","aliases":["GHSA-38w3-8j54-936j"],"title":"Malicious code in chai-as-type (npm)","description":"chai-as-type is a malicious npm package that when imported downloads a C2 dropper from https://api.npoint[.]io/c26313f0733957a7d787 and executes it (similar to malware in to chai-await-test).\n\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (75650bd9993ad4d310c42309ea4f185f9ec2bca169073315a9a1604c76830e41)\nThe package name impersonates the popular chai / chai-as-promised assertion libraries, but the code is an unrelated pino-shaped middleware whose only side effect is launching a remote-code loader. lib/caller.js issues an axios GET to https://jsonkeeper.com/b/XRGF3 (an anonymous public JSON paste host), takes the returned `data.cookie` string, constructs `new Function.constructor('require', s)`, and invokes it with the live `require` — executing arbitrary attacker-controlled JavaScript in the installer's Node process with full module access. The C2 URL is base64-encoded and stashed under fake `DEV_API_KEY` / `DEV_SECRET_KEY` keys on a locally redeclared `process` object (`aHR0cHM6Ly9qc29ua2VlcGVyLmNvbS9iL1hSR0Yz` decodes to the jsonkeeper URL); a sibling encoded URL `.../b/4NAKK` lives in lib/const.js. The loader is reached two ways: (1) when the exported `pino` middleware is invoked, index.js detaches a `child_process.spawn('node', ['lib/caller.js',...])`; (2) the package's `smoke:pino` npm script runs index.js directly. The paste-host content is mutable by the attacker at any time, so each fetch can deliver fresh payloads (credential theft, persistence, etc.) without re-publishing the package.\n","state":0,"publishedAt":"2026-04-15T22:05:03+00:00","modifiedAt":"2026-09-01T11:31:29.5773114+00:00","affected":[{"ecosystem":"npm","name":"chai-as-type","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":["7.0.5","1.1.9"],"rawVersionEvidence":null}],"metrics":[],"references":["https://www.indece.com/en-US/blog/7df041ba-feb1-4d87-918b-7fc2c709d805","https://www.npmjs.com/package/chai-as-type/v/1.1.9","https://www.sonatype.com/blog/lazarus-groups-latest-brandjacking-campaign-on-npm","https://github.com/advisories/GHSA-38w3-8j54-936j"],"sourceUrl":"https://osv.dev/vulnerability/MAL-2026-2740","license":"OSV · upstream source license applies","key":"osv:MAL-2026-2740","identifiers":["MAL-2026-2740","GHSA-38w3-8j54-936j"]},"retained":false,"historicalAffected":[]}],"coverage":[]}