MAL-2026-13699Malicious code in chai-as-bench (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | chai-as-bench | 7.0.3 |
{"modified":"2026-08-10T12:29:53Z","published":"2026-08-10T12:29:53Z","schema_version":"1.7.4","id":"MAL-2026-13699","summary":"Malicious code in chai-as-bench (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (487af469d8de2a3caa5e798df3a5d56e59b795c1ddc106abd1d38ed855b6fb17)\nThe package presents itself as a chai plugin (name resembles chai-as-promised, manifest description references chai assertions), but ships no chai-related functionality. index.js unconditionally loads lib/config.js on require(), and lib/config.js is a ~4 MB obfuscator.io payload with a 23,890-entry rotating string array, hex-obfuscated identifiers, and control-flow flattening. The remaining lib/ files (proto.js, multistream.js, transport.js) plus LICENSE are copied verbatim from the unrelated pino logger project as camouflage, and index.js itself only exports a no-op Express-style middleware ((_req,_res,next)=>next()). README contains placeholder yourusername GitHub URLs and generic author metadata (james@abscond.org). Heavy obfuscation of a multi-megabyte payload that runs on every require(), inside a package whose advertised purpose does not require any such code and whose surrounding files are stolen from an unrelated project, is the standard loader/stealer shape for an npm supply-chain plant targeting developers who mistype chai-as-promised.\n","affected":[{"package":{"ecosystem":"npm","name":"chai-as-bench"},"versions":["7.0.3"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"evidence_files":[{"path":"lib/config.js","sha256":"1176d4dea79d83166810bfe267ee4e31daa9c1b6d31c351c126bca6b1afb6a61","tlsh":"d91685889245c523d2cc13a3be557aa9f13aa96584ccb607edf9bd6cb4bc807c0b5dd0"},{"path":"package.json","sha256":"700c69833e84260ec2ab5569d184a8a406f8629f2ce9b922b710ad732165a882","tlsh":"91116660c8355da30add2590286a0626b2218e178e08bd1d33f3a01d6f9dd6f21bfe6d"}],"package_integrity":[{"filename":"chai-as-bench-7.0.3.tgz","hashes":{"sha1":"3a838814e0860c40875174445dfd4022afb4ef83","sha512_sri":"sha512-7oic+2UHOAchhGYsTLCeo7ID5P/ButB18qGin7D/u/7qgaQKEmOJMo7MH2lUWS78c3zn6TikL81FNTT8vOMfuw=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-bench/v/7.0.3"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["inspector-research@amazon.com"]}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-017267","import_time":"2026-08-10T12:51:45.105379344Z","modified_time":"2026-08-10T12:29:53Z","sha256":"487af469d8de2a3caa5e798df3a5d56e59b795c1ddc106abd1d38ed855b6fb17","source":"amazon-inspector","versions":["7.0.3"]}]}}数据来源:OpenSSF Malicious Packages · Apache-2.0