Skip to main content

Malicious code in chai-as-gateway (npm)

0
Critical
Published: 08/19/2026 (08/19/2026, 01:59:46 UTC)
Source: GCVE Database
Product: chai-as-gateway

Description

The npm package 'chai-as-gateway' version 7.1.5 contains malicious code that executes automatically upon import. It masquerades as a logger package by copying documentation from a legitimate package but actually runs a large obfuscated script. This script attempts to harvest AWS credentials by traversing directories and exfiltrates the data over HTTP. The package name and metadata are deceptive, designed to trick users into installing it. No official patch or fix is currently documented.

Affected software

npmghsa
chai-as-gateway
Affected versions
=7.1.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/19/2026, 14:41:48 UTC

Technical Analysis

The 'chai-as-gateway' npm package version 7.1.5 is a malicious package that executes attacker-controlled code immediately upon being required. Its index.js imports a heavily obfuscated ~4MB script that includes functionality to execute child processes, perform HTTP requests via axios, and traverse filesystem directories to locate AWS credentials. The package's documentation is copied from a legitimate logger package (pinojs/pino), but the actual code is a no-op middleware combined with a hidden credential harvester and exfiltration mechanism. The author metadata is generic and suspicious. This package is a supply chain threat that compromises systems by stealing sensitive AWS credentials.

Potential Impact

Systems that install and require this package will automatically execute malicious code that attempts to steal AWS credentials from the filesystem and exfiltrate them over the network. This can lead to unauthorized access to cloud resources and potential further compromise of the victim environment. The malicious behavior is triggered simply by importing the package, making it highly dangerous.

Mitigation Recommendations

No official patch or remediation is documented. Users should immediately remove version 7.1.5 of 'chai-as-gateway' from their projects and avoid installing this package. Verify dependencies to ensure this package is not included transitively. Monitor for any unauthorized AWS access and rotate credentials if this package was used. Since this is a malicious package, the best mitigation is to avoid installation and remove it if present.

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

Threat ID: 6a85b4c7acd9273b49252875

Added to database: 08/19/2026, 13:51:03 UTC

Last enriched: 08/19/2026, 14:41:48 UTC

Last updated: 10/02/2026, 13:52:36 UTC

Views: 51

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