Malicious code in chai-as-rendered (npm)
The npm package 'chai-as-rendered' is a typosquat of 'chai-as-promised' and contains malicious code. It spawns a detached child process that fetches and executes a remote JSON payload, giving the attacker full require access on the host system. The package uses base64 obfuscation to conceal the remote URL and request headers. The package name and keywords impersonate the legitimate 'pino' package to deceive users.
AI Analysis
Technical Summary
The 'chai-as-rendered' npm package version 1.2.0 is a malicious typosquatting package impersonating 'chai-as-promised' and 'pino'. Its exported middleware spawns a detached child process (lib/caller.js) that fetches a JSON payload from a base64-obfuscated URL on jsonstorage.net. The fetched payload contains a 'cookie' string that is executed via a new Function constructor, granting the fetched code full require access on the installer's host environment. The remote URL and request headers are stored as base64 strings under fake environment variable names and decoded at runtime to hide the destination. This behavior allows arbitrary code execution on any system that installs this package.
Potential Impact
Installation of 'chai-as-rendered' version 1.2.0 results in arbitrary code execution with full require access on the host system. This can lead to compromise of the host environment, data theft, or further malicious activity. The obfuscation techniques used make detection more difficult.
Mitigation Recommendations
No official patch or remediation is currently available. Users should avoid installing 'chai-as-rendered' version 1.2.0. Verify package names carefully to avoid typosquatting attacks. Remove the package if already installed and audit systems for potential compromise. Monitor trusted sources for updates or advisories regarding this package.
Malicious code in chai-as-rendered (npm)
Description
The npm package 'chai-as-rendered' is a typosquat of 'chai-as-promised' and contains malicious code. It spawns a detached child process that fetches and executes a remote JSON payload, giving the attacker full require access on the host system. The package uses base64 obfuscation to conceal the remote URL and request headers. The package name and keywords impersonate the legitimate 'pino' package to deceive users.
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-rendered' npm package version 1.2.0 is a malicious typosquatting package impersonating 'chai-as-promised' and 'pino'. Its exported middleware spawns a detached child process (lib/caller.js) that fetches a JSON payload from a base64-obfuscated URL on jsonstorage.net. The fetched payload contains a 'cookie' string that is executed via a new Function constructor, granting the fetched code full require access on the installer's host environment. The remote URL and request headers are stored as base64 strings under fake environment variable names and decoded at runtime to hide the destination. This behavior allows arbitrary code execution on any system that installs this package.
Potential Impact
Installation of 'chai-as-rendered' version 1.2.0 results in arbitrary code execution with full require access on the host system. This can lead to compromise of the host environment, data theft, or further malicious activity. The obfuscation techniques used make detection more difficult.
Mitigation Recommendations
No official patch or remediation is currently available. Users should avoid installing 'chai-as-rendered' version 1.2.0. Verify package names carefully to avoid typosquatting attacks. Remove the package if already installed and audit systems for potential compromise. Monitor trusted sources for updates or advisories regarding this package.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-12348
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a735744bf8831d539159c82
Added to database: 08/05/2026, 15:31:16 UTC
Last enriched: 08/05/2026, 17:19:24 UTC
Last updated: 08/05/2026, 17:19:24 UTC
Views: 2
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.