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-10047: Malicious code in chai-as-staged (npm)

0
Critical
Published: 07/09/2026 (07/09/2026, 15:34:00 UTC)
Source: GCVE Database
Product: chai-as-staged

Description

The npm package 'chai-as-staged' version 6.0.4 is a malicious package impersonating the legitimate 'chai-as-promised' library. It contains obfuscated code that, when used as documented, triggers execution of attacker-controlled JavaScript fetched from a remote server. This remote code execution occurs with full module require access, enabling potentially harmful operations on the user's machine.

Affected software

npmghsa
chai-as-staged
Affected versions
=6.0.4

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/10/2026, 10:18:31 UTC

Technical Analysis

The 'chai-as-staged' npm package (version 6.0.4) impersonates the popular 'chai-as-promised' testing library and includes a README copied from another unrelated project to appear legitimate. Its usage triggers a detached Node.js child process that runs an obfuscated script ('lib/initializeCaller.js'). This script hides a command-and-control (C2) endpoint and a custom HTTP header encoded in base64 under decoy environment variable names. At runtime, it decodes the URL to a remote JSON resource hosted on an anonymous static site, fetches it with the obfuscated header, extracts a '.cookie' field containing JavaScript code, and executes this code dynamically using the Function constructor with full require access. This results in arbitrary attacker-controlled code execution on the machine installing or using the package.

Potential Impact

This vulnerability allows remote attacker-controlled code execution on the user's machine with full access to Node.js require functionality. This can lead to arbitrary code execution, data theft, system compromise, or further malware deployment. The malicious package's impersonation of a legitimate library increases the risk of unsuspecting users installing it.

Mitigation Recommendations

No official patch or fix is currently available for this malicious package. Users should avoid installing or using 'chai-as-staged' version 6.0.4. Verify package authenticity before installation, prefer official and well-maintained packages, and remove any instances of this package from your environment. Monitor package sources carefully to prevent supply chain compromise.

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-10047
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a50bab068715ace43585923

Added to database: 07/10/2026, 09:26:08 UTC

Last enriched: 07/10/2026, 10:18:31 UTC

Last updated: 07/10/2026, 10:18:31 UTC

Views: 3

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