Malicious code in chai-deflect (npm)
The npm package chai-deflect contains malicious code that executes arbitrary code on any host importing the module. It does so by launching a detached child process that fetches a payload from a remote server via an HTTP GET request. If the server responds with a 404 status containing a token field, the response body is executed dynamically using new Function, enabling remote code execution. The package masquerades as a Chai assertion plugin but includes unrelated filler code and hides a secondary URL in a base64-encoded constant. This behavior classifies it as a remote-loader dropper with critical impact.
AI Analysis
Technical Summary
The chai-deflect npm package (versions 1.1.5 and 1.1.6) contains malicious code that, upon requiring the module, detaches a child process running lib/caller.js. This child process issues an HTTP GET request to a remote endpoint (http://server-genimi-check.vercel.app/defy/v3) with a bearer token header. If the response is an HTTP 404 with a body containing a token field, the body is passed to new Function and executed with the package's require function, allowing arbitrary remote code execution on the host. The package disguises itself as a security-focused Chai plugin but includes unrelated filler code and hides a secondary anonymous paste URL in a base64-encoded constant. The use of plain HTTP, 404 masquerade, and dynamic code loading indicates a remote-loader dropper malware.
Potential Impact
This vulnerability allows an attacker controlling the remote server to execute arbitrary code on any system that imports the affected versions of the chai-deflect package. This can lead to full system compromise, data theft, or further malware deployment. The malicious behavior is triggered automatically upon requiring the package, making all users of these versions at risk.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove or avoid using the affected versions (=1.1.5 and =1.1.6) of chai-deflect. Since this is a malicious package, replacing it with a trusted alternative or removing it entirely is recommended. Monitor for updates from the package repository or vendor for any official advisories or fixes.
Malicious code in chai-deflect (npm)
Description
The npm package chai-deflect contains malicious code that executes arbitrary code on any host importing the module. It does so by launching a detached child process that fetches a payload from a remote server via an HTTP GET request. If the server responds with a 404 status containing a token field, the response body is executed dynamically using new Function, enabling remote code execution. The package masquerades as a Chai assertion plugin but includes unrelated filler code and hides a secondary URL in a base64-encoded constant. This behavior classifies it as a remote-loader dropper with critical impact.
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-deflect npm package (versions 1.1.5 and 1.1.6) contains malicious code that, upon requiring the module, detaches a child process running lib/caller.js. This child process issues an HTTP GET request to a remote endpoint (http://server-genimi-check.vercel.app/defy/v3) with a bearer token header. If the response is an HTTP 404 with a body containing a token field, the body is passed to new Function and executed with the package's require function, allowing arbitrary remote code execution on the host. The package disguises itself as a security-focused Chai plugin but includes unrelated filler code and hides a secondary anonymous paste URL in a base64-encoded constant. The use of plain HTTP, 404 masquerade, and dynamic code loading indicates a remote-loader dropper malware.
Potential Impact
This vulnerability allows an attacker controlling the remote server to execute arbitrary code on any system that imports the affected versions of the chai-deflect package. This can lead to full system compromise, data theft, or further malware deployment. The malicious behavior is triggered automatically upon requiring the package, making all users of these versions at risk.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove or avoid using the affected versions (=1.1.5 and =1.1.6) of chai-deflect. Since this is a malicious package, replacing it with a trusted alternative or removing it entirely is recommended. Monitor for updates from the package repository or vendor for any official advisories or fixes.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-10051
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a50ba9f68715ace43584ce3
Added to database: 07/10/2026, 09:25:51 UTC
Last enriched: 09/12/2026, 19:31:29 UTC
Last updated: 09/13/2026, 01:34:09 UTC
Views: 64
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.