Malicious code in chai-as-bench (npm)
The npm package 'chai-as-bench' version 7.0.3 is a malicious supply-chain threat masquerading as a chai plugin. It contains a heavily obfuscated multi-megabyte payload that executes on every require(), unrelated to its advertised functionality. The package includes stolen files from an unrelated project as camouflage and exports a no-op middleware. This behavior is typical of npm packages designed to target developers who mistype legitimate package names.
AI Analysis
Technical Summary
The 'chai-as-bench' npm package (version 7.0.3) falsely presents itself as a chai plugin but contains no chai-related functionality. Instead, it loads a heavily obfuscated ~4 MB payload on require(), featuring a large rotating string array, hex-obfuscated identifiers, and control-flow flattening. Other files in the package are copied verbatim from the unrelated 'pino' logger project to disguise its malicious intent. The package exports only a no-op Express-style middleware function. This pattern is consistent with supply-chain attacks targeting developers who accidentally install similarly named malicious packages.
Potential Impact
The malicious payload runs automatically when the package is required, potentially enabling unauthorized code execution or data exfiltration in developer environments. The obfuscation and camouflage increase the difficulty of detection. While no active exploits in the wild are reported, the package poses a significant risk to development supply chains if mistakenly installed.
Mitigation Recommendations
No official patch or fix is available for this malicious package. The recommended mitigation is to avoid installing 'chai-as-bench' version 7.0.3 and verify package names carefully before installation. Use trusted package sources and consider implementing supply-chain security measures such as package integrity verification and dependency auditing.
Malicious code in chai-as-bench (npm)
Description
The npm package 'chai-as-bench' version 7.0.3 is a malicious supply-chain threat masquerading as a chai plugin. It contains a heavily obfuscated multi-megabyte payload that executes on every require(), unrelated to its advertised functionality. The package includes stolen files from an unrelated project as camouflage and exports a no-op middleware. This behavior is typical of npm packages designed to target developers who mistype legitimate package names.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'chai-as-bench' npm package (version 7.0.3) falsely presents itself as a chai plugin but contains no chai-related functionality. Instead, it loads a heavily obfuscated ~4 MB payload on require(), featuring a large rotating string array, hex-obfuscated identifiers, and control-flow flattening. Other files in the package are copied verbatim from the unrelated 'pino' logger project to disguise its malicious intent. The package exports only a no-op Express-style middleware function. This pattern is consistent with supply-chain attacks targeting developers who accidentally install similarly named malicious packages.
Potential Impact
The malicious payload runs automatically when the package is required, potentially enabling unauthorized code execution or data exfiltration in developer environments. The obfuscation and camouflage increase the difficulty of detection. While no active exploits in the wild are reported, the package poses a significant risk to development supply chains if mistakenly installed.
Mitigation Recommendations
No official patch or fix is available for this malicious package. The recommended mitigation is to avoid installing 'chai-as-bench' version 7.0.3 and verify package names carefully before installation. Use trusted package sources and consider implementing supply-chain security measures such as package integrity verification and dependency auditing.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13699
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a79f0d2bf8831d539f60f3c
Added to database: 08/10/2026, 15:40:02 UTC
Last enriched: 08/10/2026, 15:52:58 UTC
Last updated: 08/10/2026, 15:52:58 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.