Malicious code in chai-as-indexed (npm)
The npm package 'chai-as-indexed' version 7.2.8 contains malicious code that exfiltrates the full environment variables of the installer's Node.js process to a remote server. The package's main entry point loads a module that sends process.env data to a base64-encoded URL, then executes arbitrary code returned from that server in the importing process context. This behavior allows remote code execution on every load of the package. The package masquerades as a legitimate chai plugin, and the command-and-control server URL is obfuscated using base64 encoding to evade detection.
AI Analysis
Technical Summary
The 'chai-as-indexed' npm package version 7.2.8 is malicious. Its main entry file index.js requires a module that POSTs the full process.env object of the Node.js process to a remote endpoint concealed via base64 encoding. The response from this endpoint is treated as JavaScript code and executed dynamically using the Function constructor with the real require function passed in, enabling arbitrary code execution within the importing process. The package name and description are designed to appear as a legitimate chai plugin, while the C2 server URL is obfuscated to avoid static analysis detection.
Potential Impact
This malicious package exfiltrates sensitive environment variables from the host system and allows remote arbitrary code execution within the Node.js process that imports it. This can lead to compromise of the host environment, data leakage, and potential further exploitation depending on the environment variables and privileges of the Node.js process.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove and avoid using the 'chai-as-indexed' package version 7.2.8. Verify dependencies and replace this package with a trusted alternative. Conduct environment audits to detect any unauthorized data exfiltration or code execution resulting from this package. Monitor for updates from the package maintainer or npm security advisories for any remediation.
Malicious code in chai-as-indexed (npm)
Description
The npm package 'chai-as-indexed' version 7.2.8 contains malicious code that exfiltrates the full environment variables of the installer's Node.js process to a remote server. The package's main entry point loads a module that sends process.env data to a base64-encoded URL, then executes arbitrary code returned from that server in the importing process context. This behavior allows remote code execution on every load of the package. The package masquerades as a legitimate chai plugin, and the command-and-control server URL is obfuscated using base64 encoding to evade detection.
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-indexed' npm package version 7.2.8 is malicious. Its main entry file index.js requires a module that POSTs the full process.env object of the Node.js process to a remote endpoint concealed via base64 encoding. The response from this endpoint is treated as JavaScript code and executed dynamically using the Function constructor with the real require function passed in, enabling arbitrary code execution within the importing process. The package name and description are designed to appear as a legitimate chai plugin, while the C2 server URL is obfuscated to avoid static analysis detection.
Potential Impact
This malicious package exfiltrates sensitive environment variables from the host system and allows remote arbitrary code execution within the Node.js process that imports it. This can lead to compromise of the host environment, data leakage, and potential further exploitation depending on the environment variables and privileges of the Node.js process.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove and avoid using the 'chai-as-indexed' package version 7.2.8. Verify dependencies and replace this package with a trusted alternative. Conduct environment audits to detect any unauthorized data exfiltration or code execution resulting from this package. Monitor for updates from the package maintainer or npm security advisories for any remediation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-16293
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6aade4fd55bf5e2cf5eda93b
Added to database: 09/19/2026, 01:27:25 UTC
Last enriched: 09/19/2026, 01:36:14 UTC
Last updated: 09/19/2026, 02:02:07 UTC
Views: 3
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.