chai-as-promised-plusnpm
Advisory published Updated
chai-as-promised-plus is a confirmed malicious npm package (MAL-2026-13703) that typosquats a legitimate package to trick installs (malicious version 6.1.3). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in chai-as-promised-plus (npm)
What this malware does
The 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.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
TyposquatFind it
Search your lockfiles and build artifacts for chai-as-promised-plus (version 6.1.3).
If you installed it — respond
chai-as-promised-plus is a typosquat — you almost certainly intended a legitimately-named package. Remove chai-as-promised-plus, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.
Did it already run?
If chai-as-promised-plus was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks chai-as-promised-plus-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.