Skip to main content

Malicious code in chai-as-inspired (npm)

0
Critical
Published: 08/05/2026 (08/05/2026, 13:33:19 UTC)
Source: GCVE Database
Product: chai-as-inspired

Description

The npm package 'chai-as-inspired' is a typosquatting malicious package that executes attacker-controlled JavaScript code with full Node.js privileges. It achieves this by spawning a detached child process that fetches remote code from a mutable JSON storage endpoint, then executes it in a retry loop. The remote code can be changed at any time by the attacker, enabling ongoing malicious activity. This package version 2.2.4 is affected.

Affected software

npmghsa
chai-as-inspired
Affected versions
=2.2.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: 09/12/2026, 07:16:34 UTC

Technical Analysis

The 'chai-as-inspired' npm package (version 2.2.4) is a typosquatting malicious package resembling legitimate packages like 'chai' and 'pino'. Its main entry point spawns a detached child Node.js process which fetches JavaScript code from a remote JSON storage service. The URL and secret header used to fetch this code are obfuscated using base64 encoding. The fetched code is executed dynamically using the Function constructor with full access to Node.js require, allowing arbitrary code execution with the installer's privileges. The remote code is hosted on a mutable anonymous JSON bucket, allowing the attacker to change the payload at any time, establishing persistent hostile intent.

Potential Impact

This vulnerability allows an attacker to execute arbitrary JavaScript code with full Node.js privileges on any system that installs this package version. Because the remote code is fetched dynamically from a mutable storage endpoint, the attacker can change the payload at will, potentially leading to persistent compromise, data theft, or further system exploitation.

Mitigation Recommendations

No official patch or remediation is currently available. Users should immediately remove the 'chai-as-inspired' package version 2.2.4 from their projects and avoid installing similarly named typosquatting packages. Use trusted package sources and verify package authenticity before installation. Monitor for any unexpected network activity related to this package and audit dependencies for malicious code.

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-12540
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a73573dbf8831d539153507

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

Last enriched: 09/12/2026, 07:16:34 UTC

Last updated: 09/12/2026, 07:16:34 UTC

Views: 17

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