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…

Malicious code in chai-assertions-plus (npm)

0
Critical
Published: 08/05/2026 (08/05/2026, 12:55:26 UTC)
Source: GCVE Database
Product: chai-assertions-plus

Description

The npm package chai-assertions-plus, published as a Chai assertions extension, contains malicious code that executes arbitrary code on the installer's machine. The package's code replaces the global process object with a fake one containing base64-encoded data that reconstructs a URL and HTTP header. At runtime, it fetches code from this URL and executes it using the Node.js require function. This behavior occurs on every import of the module, indicating deliberate deception. Versions 6.0.5 and 6.0.6 are affected. No CVSS score is available.

Affected software

npmghsa
chai-assertions-plus
Affected versions
=6.0.6=6.0.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: 08/05/2026, 17:06:08 UTC

Technical Analysis

The npm package chai-assertions-plus masquerades as a Chai assertions extension but contains unrelated filler code and a malicious payload. Upon requiring the package, a top-level immediately invoked function expression (IIFE) shadows the global process object with a fake object whose environment fields hold base64-encoded strings. These strings decode at runtime to form a destination URL and an HTTP header. The package performs an axios GET request to this URL, then executes the returned response body as code via new Function("require", response), passing the real require function. This allows arbitrary code execution with the package's require capability on the user's machine every time the module is imported. The mismatch between the package name/description and the code, as well as the obfuscated endpoint and headers, indicate intentional malicious behavior rather than misconfiguration.

Potential Impact

This malicious package enables arbitrary code execution on any system that installs and imports it, potentially allowing attackers to execute any code with the privileges of the user running the Node.js process. This can lead to system compromise, data theft, or further malware deployment. The attack is triggered automatically on import, increasing risk of unnoticed exploitation.

Mitigation Recommendations

No official patch or remediation is currently documented. Users should immediately avoid installing or importing chai-assertions-plus versions 6.0.5 and 6.0.6. Remove the package from existing projects and replace it with a trusted alternative. Monitor for any unexpected network requests or code execution related to this package. Check vendor advisories or npm security advisories for updates or official guidance.

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

Threat ID: 6a735741bf8831d5391577c2

Added to database: 08/05/2026, 15:31:13 UTC

Last enriched: 08/05/2026, 17:06:08 UTC

Last updated: 08/06/2026, 00:07:32 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