Malicious code in chai-as-reddit (npm)
Description
The npm package chai-as-reddit versions 7.0.2, 7.0.3, and 7.0.4 contain a trojaned distribution that executes a heavily obfuscated malicious payload immediately upon import or require. The package masquerades as a Chai plugin for Reddit API assertions but includes camouflage files copied from an unrelated project and an obfuscated 4MB JavaScript file that runs automatically, indicating a supply-chain attack. Any system with this package installed should be considered fully compromised.
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 npm package chai-as-reddit versions 7.0.2, 7.0.3, and 7.0.4 are trojaned. The package metadata and README claim it is a Chai plugin for Reddit API assertions, but the shipped files are copied from the unrelated Pino logger project to camouflage the true intent. The actual entry point, index.js, loads a large (~4 MB) heavily obfuscated JavaScript payload (lib/config.js) that executes immediately upon requiring the package. This payload uses obfuscation techniques such as hex-string identifiers, a large rotating string array, control-flow flattening, and encoded wrappers, characteristic of supply-chain execution malware. The payload runs in the installer's Node.js process before any exported API is invoked, potentially compromising the host system.
Potential Impact
Any computer with this package installed or running is considered fully compromised. The malicious payload executes automatically on import, potentially allowing an attacker full control over the system. All secrets and keys stored on the compromised computer should be considered exposed and must be rotated from a different, secure machine. Removing the package does not guarantee removal of all malicious software installed as a result of this compromise.
Defensive Guidance
Remove the affected versions (=7.0.2, =7.0.3, =7.0.4) of the chai-as-reddit package immediately. Rotate all secrets and keys stored on the compromised system from a separate, secure environment. Due to the nature of the compromise, assume full system compromise and consider rebuilding the affected system to ensure complete remediation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10939
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-vc32-h28h-pmhm"]
- Ecosystems
- ["npm"]
Threat ID: 6a96f319acd9273b49e49729
Added to database: 09/01/2026, 15:45:29 UTC
Last enriched: 09/08/2026, 09:08:19 UTC
Last updated: 10/04/2026, 07:33:37 UTC
Views: 25
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.
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.