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-10050: Malicious code in chai-defender (npm)

0
Critical
Published: 07/09/2026 (07/09/2026, 15:29:51 UTC)
Source: GCVE Database
Product: chai-defender

Description

The npm package 'chai-defender' contains malicious code that executes attacker-controlled JavaScript during its installation. When required, it spawns a detached Node.js process that fetches code from a remote HTTP endpoint and executes it with access to Node's require function, enabling remote code execution. The package masquerades as a security-focused Chai assertions plugin but performs no legitimate assertion functionality. The malicious behavior affects multiple specific versions of the package. This poses a severe risk to any project that includes this package as it grants full remote code execution to the attacker controlling the remote server.

Affected software

npmghsa
chai-defender
Affected versions
=1.0.2=1.0.0-beta.1=1.0.1-beta=1.0.1=1.1.0=1.1.1

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, 09:45:13 UTC

Technical Analysis

The 'chai-defender' npm package (versions =1.0.0-beta.1, =1.0.1-beta, =1.0.1, =1.0.2, =1.1.0, =1.1.1) contains malicious code that, upon require, launches a detached Node.js process executing code fetched via HTTP from a hardcoded remote endpoint (http://check-server-state.vercel.app/server/v2). This code is executed using the Function constructor with access to Node's require, enabling arbitrary remote code execution in the context of the installing process. The package falsely presents itself as a Chai assertion plugin, but the fetch-and-execute behavior is unrelated to any legitimate functionality. Additional files mimic legitimate logger project files to appear substantial but are not used. The use of plain HTTP exposes the fetch to in-path payload injection. Any project requiring this package implicitly trusts and executes attacker-controlled code.

Potential Impact

Any project that installs or requires the affected versions of 'chai-defender' is vulnerable to remote code execution controlled by the attacker hosting the malicious payload. This allows arbitrary code execution with the privileges of the Node.js process, potentially leading to full system compromise, data theft, or further malware deployment. The use of plain HTTP for fetching the payload increases the risk of man-in-the-middle attacks injecting malicious code.

Mitigation Recommendations

No official patch or remediation is currently documented. Users should immediately remove and avoid using the 'chai-defender' package in all affected versions (=1.0.0-beta.1, =1.0.1-beta, =1.0.1, =1.0.2, =1.1.0, =1.1.1). Since the package executes remote code on install, uninstalling and replacing it with a trusted alternative is critical. Monitor dependency trees for transitive inclusion of this package and remove it. Check vendor advisories or npm security advisories for updates or official fixes.

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

Threat ID: 6a50ba5c68715ace4357efeb

Added to database: 07/10/2026, 09:24:44 UTC

Last enriched: 07/10/2026, 09:45:13 UTC

Last updated: 07/10/2026, 09:45:13 UTC

Views: 2

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