Malicious code in chai-smart (npm)
The npm package 'chai-smart' version 2.3.5 contains malicious code that masquerades as a pino-like logger API. It spawns a detached Node.js child process that decodes a hardcoded URL and sends the full environment variables of the consuming process to an attacker-controlled endpoint. The response from this endpoint is executed as arbitrary code within the consumer's Node.js process, enabling both credential exfiltration and remote code execution.
AI Analysis
Technical Summary
The 'chai-smart' npm package (version 2.3.5) exports middleware that launches a detached Node.js child process running a script which base64-decodes a hardcoded URL. This script sends a POST request containing the entire environment variables of the consumer process to an attacker-controlled server. The server's response is then executed dynamically as JavaScript code with access to the package's require function. This results in two simultaneous malicious actions: exfiltration of sensitive environment data (such as cloud credentials, tokens, and database passwords) and arbitrary code execution within the consumer's Node.js environment. The package's name and description are deceptive, serving as a cover for this malicious behavior.
Potential Impact
This vulnerability allows attackers to exfiltrate sensitive environment variables from the victim's process, potentially exposing cloud credentials, tokens, and database passwords. Additionally, it enables arbitrary code execution within the consumer's Node.js process, which could lead to full system compromise or further malicious activities. The severity is critical due to the combination of data theft and remote code execution.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove or avoid using the 'chai-smart' package version 2.3.5. Since the package is malicious by design, replacing it with a trusted alternative and auditing systems for potential compromise is recommended. Monitor vendor advisories for any updates or official fixes.
Malicious code in chai-smart (npm)
Description
The npm package 'chai-smart' version 2.3.5 contains malicious code that masquerades as a pino-like logger API. It spawns a detached Node.js child process that decodes a hardcoded URL and sends the full environment variables of the consuming process to an attacker-controlled endpoint. The response from this endpoint is executed as arbitrary code within the consumer's Node.js process, enabling both credential exfiltration and remote code execution.
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-smart' npm package (version 2.3.5) exports middleware that launches a detached Node.js child process running a script which base64-decodes a hardcoded URL. This script sends a POST request containing the entire environment variables of the consumer process to an attacker-controlled server. The server's response is then executed dynamically as JavaScript code with access to the package's require function. This results in two simultaneous malicious actions: exfiltration of sensitive environment data (such as cloud credentials, tokens, and database passwords) and arbitrary code execution within the consumer's Node.js environment. The package's name and description are deceptive, serving as a cover for this malicious behavior.
Potential Impact
This vulnerability allows attackers to exfiltrate sensitive environment variables from the victim's process, potentially exposing cloud credentials, tokens, and database passwords. Additionally, it enables arbitrary code execution within the consumer's Node.js process, which could lead to full system compromise or further malicious activities. The severity is critical due to the combination of data theft and remote code execution.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove or avoid using the 'chai-smart' package version 2.3.5. Since the package is malicious by design, replacing it with a trusted alternative and auditing systems for potential compromise is recommended. Monitor vendor advisories for any updates or official fixes.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10054
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a50bac068715ace4358774a
Added to database: 07/10/2026, 09:26:24 UTC
Last enriched: 09/12/2026, 19:01:56 UTC
Last updated: 09/13/2026, 16:48:26 UTC
Views: 127
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.