MAL-2026-13703Malicious code in chai-as-promised-plus (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | chai-as-promised-plus | 6.1.3 |
{"modified":"2026-08-10T12:31:42Z","published":"2026-08-10T12:31:42Z","schema_version":"1.7.4","id":"MAL-2026-13703","summary":"Malicious code in chai-as-promised-plus (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (be02bee1e19ad24ae6091f0793dc22af62e54030388bbdc7d1aa29b078ac17a5)\nThe package name mimics the widely-used chai-as-promised assertion helper and reuses its README/description. lib/chai-as-promised-plus.js defines the legitimate plugin factory and then overwrites module.exports with require('./config/config'), so any consumer that imports the package loads lib/config/config.js. That file is a 3,546,568-byte single-line javascript-obfuscator.io bundle (rotated string array of length 20721, two decoder functions, control-flow-flattening dispatcher of the form while(!![]){try{...}catch(o){y.push(y.shift())}}, hex-keyed object literals). A test-assertion helper has no legitimate need to ship a multi-megabyte obfuscated blob that replaces its exports at load time; the concealed payload runs in the consumer's Node.js process on require, which is the standard shape of a typosquat supply-chain attack delivering attacker-controlled code to the installer.\n","affected":[{"package":{"ecosystem":"npm","name":"chai-as-promised-plus"},"versions":["6.1.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/chai-as-promised-plus.js","sha256":"d0066243633f49a6a37f582bf948d380a22645c021fa66b35a23203d01d078e4","tlsh":"966212195aa35d230067b37c738f6406e1398a275034ee907afc93596f0692cd6a3bf9"},{"path":"lib/config/config.js","sha256":"1e3f9c43442ed0d25dcaa88833a12cf68ab3865c55031308fe4b5e8ec29c3a92","tlsh":"70f5b8487971e03783dd1767be4a1fece63a186694c8a52b8558bd9f39bc107c1a3ce0"}],"package_integrity":[{"filename":"chai-as-promised-plus-6.1.3.tgz","hashes":{"sha1":"c0e63a51feeb5a4d4f00ba5bb34b1e1046953c2f","sha512_sri":"sha512-fbSoV8jKtWb+QcJdWqJQhlhd1teMNrVlJhd/3iUtxtp428c0nURVR22FRCwje5mOsz9kXVB5RAws3DrI57aENw=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/chai-as-promised-plus/v/6.1.3"}],"credits":[{"name":"Amazon Inspector","type":"FINDER","contact":["inspector-research@amazon.com"]}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-017270","import_time":"2026-08-10T12:51:45.228011785Z","modified_time":"2026-08-10T12:31:42Z","sha256":"be02bee1e19ad24ae6091f0793dc22af62e54030388bbdc7d1aa29b078ac17a5","source":"amazon-inspector","versions":["6.1.3"]}]}}数据来源:OpenSSF Malicious Packages · Apache-2.0