Malicious code in chai-as-inspired (npm)
The npm package 'chai-as-inspired' is a typosquatting malicious package that executes attacker-controlled JavaScript code with full Node.js privileges. It achieves this by spawning a detached child process that fetches remote code from a mutable JSON storage endpoint, then executes it in a retry loop. The remote code can be changed at any time by the attacker, enabling ongoing malicious activity. This package version 2.2.4 is affected.
AI Analysis
Technical Summary
The 'chai-as-inspired' npm package (version 2.2.4) is a typosquatting malicious package resembling legitimate packages like 'chai' and 'pino'. Its main entry point spawns a detached child Node.js process which fetches JavaScript code from a remote JSON storage service. The URL and secret header used to fetch this code are obfuscated using base64 encoding. The fetched code is executed dynamically using the Function constructor with full access to Node.js require, allowing arbitrary code execution with the installer's privileges. The remote code is hosted on a mutable anonymous JSON bucket, allowing the attacker to change the payload at any time, establishing persistent hostile intent.
Potential Impact
This vulnerability allows an attacker to execute arbitrary JavaScript code with full Node.js privileges on any system that installs this package version. Because the remote code is fetched dynamically from a mutable storage endpoint, the attacker can change the payload at will, potentially leading to persistent compromise, data theft, or further system exploitation.
Mitigation Recommendations
No official patch or remediation is currently available. Users should immediately remove the 'chai-as-inspired' package version 2.2.4 from their projects and avoid installing similarly named typosquatting packages. Use trusted package sources and verify package authenticity before installation. Monitor for any unexpected network activity related to this package and audit dependencies for malicious code.
Malicious code in chai-as-inspired (npm)
Description
The npm package 'chai-as-inspired' is a typosquatting malicious package that executes attacker-controlled JavaScript code with full Node.js privileges. It achieves this by spawning a detached child process that fetches remote code from a mutable JSON storage endpoint, then executes it in a retry loop. The remote code can be changed at any time by the attacker, enabling ongoing malicious activity. This package version 2.2.4 is affected.
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-inspired' npm package (version 2.2.4) is a typosquatting malicious package resembling legitimate packages like 'chai' and 'pino'. Its main entry point spawns a detached child Node.js process which fetches JavaScript code from a remote JSON storage service. The URL and secret header used to fetch this code are obfuscated using base64 encoding. The fetched code is executed dynamically using the Function constructor with full access to Node.js require, allowing arbitrary code execution with the installer's privileges. The remote code is hosted on a mutable anonymous JSON bucket, allowing the attacker to change the payload at any time, establishing persistent hostile intent.
Potential Impact
This vulnerability allows an attacker to execute arbitrary JavaScript code with full Node.js privileges on any system that installs this package version. Because the remote code is fetched dynamically from a mutable storage endpoint, the attacker can change the payload at will, potentially leading to persistent compromise, data theft, or further system exploitation.
Mitigation Recommendations
No official patch or remediation is currently available. Users should immediately remove the 'chai-as-inspired' package version 2.2.4 from their projects and avoid installing similarly named typosquatting packages. Use trusted package sources and verify package authenticity before installation. Monitor for any unexpected network activity related to this package and audit dependencies for malicious code.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-12540
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a73573dbf8831d539153507
Added to database: 08/05/2026, 15:31:09 UTC
Last enriched: 09/12/2026, 07:16:34 UTC
Last updated: 09/12/2026, 07:16:34 UTC
Views: 17
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.