MAL-2026-10175: Malicious code in chai-as-doc (npm)
The npm package chai-as-doc version 2.3.5 is a malicious typosquatting package that masquerades as pino-style logging middleware. Upon being required, it spawns a detached Node.js child process that executes a script which base64-decodes a hardcoded URL and sends the entire environment variables (process.env) to this remote endpoint. The response from the endpoint is then executed as code with full access to the local require function, enabling arbitrary code execution within the installer's Node process with full environment and credential access.
AI Analysis
Technical Summary
The malicious npm package chai-as-doc (version 2.3.5) performs a supply-chain attack by executing hidden code upon require(). It spawns a detached Node child process running lib/initializeCaller.js, which base64-decodes a hardcoded URL and POSTs the entire process.env object to that remote endpoint with a secret header. The HTTP response body is then executed dynamically using new Function, passing the local require, allowing the remote host to execute arbitrary code with full environment and credential access. The package name and behavior indicate a typosquatting attempt targeting developers expecting chai or chai-as-promised packages.
Potential Impact
This vulnerability allows an attacker controlling the remote endpoint to execute arbitrary code within the Node.js process of the user installing or requiring the package. This includes access to all environment variables and credentials available to the process, potentially leading to credential theft, system compromise, or further malicious activity within the affected environment.
Mitigation Recommendations
No official patch or remediation is currently available. Users should avoid installing or using chai-as-doc version 2.3.5. Verify package names carefully to avoid typosquatting attacks and prefer official, well-maintained packages. Monitor for updates or advisories from trusted sources regarding this package.
MAL-2026-10175: Malicious code in chai-as-doc (npm)
Description
The npm package chai-as-doc version 2.3.5 is a malicious typosquatting package that masquerades as pino-style logging middleware. Upon being required, it spawns a detached Node.js child process that executes a script which base64-decodes a hardcoded URL and sends the entire environment variables (process.env) to this remote endpoint. The response from the endpoint is then executed as code with full access to the local require function, enabling arbitrary code execution within the installer's Node process with full environment and credential access.
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 malicious npm package chai-as-doc (version 2.3.5) performs a supply-chain attack by executing hidden code upon require(). It spawns a detached Node child process running lib/initializeCaller.js, which base64-decodes a hardcoded URL and POSTs the entire process.env object to that remote endpoint with a secret header. The HTTP response body is then executed dynamically using new Function, passing the local require, allowing the remote host to execute arbitrary code with full environment and credential access. The package name and behavior indicate a typosquatting attempt targeting developers expecting chai or chai-as-promised packages.
Potential Impact
This vulnerability allows an attacker controlling the remote endpoint to execute arbitrary code within the Node.js process of the user installing or requiring the package. This includes access to all environment variables and credentials available to the process, potentially leading to credential theft, system compromise, or further malicious activity within the affected environment.
Mitigation Recommendations
No official patch or remediation is currently available. Users should avoid installing or using chai-as-doc version 2.3.5. Verify package names carefully to avoid typosquatting attacks and prefer official, well-maintained packages. Monitor for updates or advisories from trusted sources regarding this package.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10175
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a520eaf68715ace438f4c97
Added to database: 07/11/2026, 09:36:47 UTC
Last enriched: 07/11/2026, 09:47:47 UTC
Last updated: 07/12/2026, 03:33:22 UTC
Views: 5
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.