Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

MAL-2026-10175: Malicious code in chai-as-doc (npm)

0
Critical
Published: 07/10/2026 (07/10/2026, 21:24:50 UTC)
Source: GCVE Database
Product: chai-as-doc

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

npmghsa
chai-as-doc
Affected versions
=2.3.5

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

AILast updated: 07/11/2026, 09:47:47 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses