Malicious code in chai-as-sets (npm)
The npm package chai-as-sets version 3.1.3 contains malicious code that executes upon module load. It spawns a detached child process which decodes a hardcoded URL and sends the installer's environment variables to a remote server. The server's response is executed as code with access to the package's require function, enabling arbitrary remote code execution. The package attempts to disguise itself by impersonating another library (pino).
AI Analysis
Technical Summary
The chai-as-sets package version 3.1.3 is a malicious npm package that, when required, spawns a detached child process executing lib/initializeCaller.js. This process base64-decodes a hardcoded URL pointing to a command-and-control server and POSTs the entire process environment variables to it. The server's HTTP response body is then passed to a new Function constructor with require injected, allowing the remote server to execute arbitrary code on the host. The package masquerades as a pino-related module to evade detection. This behavior constitutes a supply chain attack via a malicious package.
Potential Impact
Any system that installs and requires chai-as-sets version 3.1.3 is at risk of arbitrary remote code execution controlled by the attacker. The attacker can exfiltrate environment variables and execute arbitrary code with the privileges of the process loading the package. This can lead to full system compromise depending on the environment and privileges.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove and avoid using chai-as-sets version 3.1.3. Audit dependencies for this package and replace it with a trusted alternative. Monitor for any unexpected network connections to the indicated C2 URL. Patch status is not yet confirmed — check the vendor advisory or trusted sources for updates.
Malicious code in chai-as-sets (npm)
Description
The npm package chai-as-sets version 3.1.3 contains malicious code that executes upon module load. It spawns a detached child process which decodes a hardcoded URL and sends the installer's environment variables to a remote server. The server's response is executed as code with access to the package's require function, enabling arbitrary remote code execution. The package attempts to disguise itself by impersonating another library (pino).
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-sets package version 3.1.3 is a malicious npm package that, when required, spawns a detached child process executing lib/initializeCaller.js. This process base64-decodes a hardcoded URL pointing to a command-and-control server and POSTs the entire process environment variables to it. The server's HTTP response body is then passed to a new Function constructor with require injected, allowing the remote server to execute arbitrary code on the host. The package masquerades as a pino-related module to evade detection. This behavior constitutes a supply chain attack via a malicious package.
Potential Impact
Any system that installs and requires chai-as-sets version 3.1.3 is at risk of arbitrary remote code execution controlled by the attacker. The attacker can exfiltrate environment variables and execute arbitrary code with the privileges of the process loading the package. This can lead to full system compromise depending on the environment and privileges.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove and avoid using chai-as-sets version 3.1.3. Audit dependencies for this package and replace it with a trusted alternative. Monitor for any unexpected network connections to the indicated C2 URL. Patch status is not yet confirmed — check the vendor advisory or trusted sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10519
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a55ff7d68715ace432f3881
Added to database: 07/14/2026, 09:21:01 UTC
Last enriched: 07/14/2026, 09:40:09 UTC
Last updated: 07/28/2026, 06:54:57 UTC
Views: 35
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.