chai-as-stringifynpm
chai-as-stringify is a confirmed malicious npm package (MAL-2026-11032) that typosquats a legitimate package to trick installs (malicious versions 7.0.1, 7.0.2). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in chai-as-stringify (npm)
What this malware does
[email protected] is a typosquat of chai-as-promised. The tarball ships lib/config/config.env, a ~4MB heavily obfuscated JavaScript payload using obfuscator.io-style transforms (string-array shuffler, hex _0x... identifiers, char-code lookup, control-flow flattening). The .env extension conceals the JS blob from scanners that only inspect .js files. The package's top-level index.js executes require('./lib/config/config'), which resolves to this staged blob and runs it whenever the module is loaded. The package's advertised purpose is unrelated cover: the README is plagiarized verbatim from pino (Transports, Low overhead, nearForm/Platformatic acknowledgments) while claiming to provide 'Chai assertions for testing Reddit API responses'; author metadata is a generic [email protected] with homepage https://github.com/james; CI badges point at the placeholder github.com/yourusername/chai-as-stringify; the visible exported API is a no-op middleware stub. The combination of a typosquat name, plagiarized/placeholder metadata, and a large obfuscated payload staged under a non-JS extension and auto-loaded on require is the smuggle-and-cover-story supply-chain attack shape.
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
TyposquatFind it
Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for chai-as-stringify (2 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging chai-as-stringify across your stack and pipelines.
If you installed it — respond
chai-as-stringify is a typosquat — you almost certainly intended a legitimately-named package. Remove chai-as-stringify, 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-stringify was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.
How O3 protects you
O3 blocks chai-as-stringify before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks chai-as-stringify-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.