Malicious code in gpt-terminal-cli (npm)
gpt-terminal-cli, an npm package advertised as an AI chat CLI, contains malicious code that installs a persistent remote access implant with extensive capabilities including reverse shell, credential theft, keylogging, and antiforensics. The implant communicates with a hardcoded C2 server and supports dynamic C2 rotation via DNS dead-drop.
- Disclosed
- Last updated
- Blast radius
- All npm users who installed gpt-terminal-cli; systems running the package are compromised with persistent remote access and data exfiltration capabilities.
- Ecosystems
- Attack vectors
- Affected entities
- gpt-terminal-clinpm package containing malicious postinstall script and embedded implant
gpt-terminal-cli is an npm package that advertises itself as an AI chat CLI but contains embedded malicious code. Upon installation, the package's postinstall script (scripts.postinstall) executes src/postinstall.js, which spawns src/implant/loader.js as a detached background daemon with persistence mechanisms.\n\nThe loader implements a watchdog process that polls every 20 seconds to respawn the implant if killed, supporting up to 50 automatic revives. The implant communicates with a hardcoded C2 endpoint at http://13.60.13.215:7771 using an AES-256-GCM + HMAC-signed opcode protocol. Capabilities include remote shell execution, Python code execution, PTY shells, file download/upload, persistence installation, screenshot capture, keylogging, clipboard theft, webcam access, microphone access, browser credential theft, file exfiltration, lateral movement, privilege escalation, and antiforensics.\n\nThe implant opens a WebSocket connection to /pty/ on the C2 host and pipes remote base64-decoded commands into cmd.exe (Windows) or /bin/bash (Unix), with output relayed back to the attacker. On Windows, the implant prepends AMSI-bypass reflection stubs to PowerShell invocations to evade detection. The C2 infrastructure supports dynamic rotation: the implant polls DNS TXT records on a dead-drop domain every 30 minutes to update the C2 URL and HMAC secret at runtime, enabling attacker infrastructure changes without package updates.\n\nThe package was identified via Amazon Inspector and reported to GitHub Advisories (GHSA-x33m-j487-w85g).
Indicators of compromise
- Packages
- gpt-terminal-cli
- IPs
- 13.60.13.215
Remediation
- Immediately uninstall gpt-terminal-cli from all systems
- Kill any running processes spawned by the package (loader.js, implant processes)
- Scan systems for persistence mechanisms and remove them
- Rotate all credentials and secrets that may have been exposed
- Review browser credential stores and change passwords for all accounts
- Check system logs and network traffic for signs of lateral movement or data exfiltration
- Monitor for unexpected outbound connections to 13.60.13.215:7771 or related C2 infrastructure
- Implement network-level blocking of the identified C2 IP address
- Audit npm package dependencies for similar malicious packages
Sources
- GitHub Advisory GHSA-x33m-j487-w85g · GitHub Advisory Database
Cite this entry
"Malicious code in gpt-terminal-cli (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 7, 2026; last updated August 7, 2026. https://supplychainattack.org/incident/malicious-code-in-gpt-terminal-cli-npm-n2e05i
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in akamaijs-sensor (npm)
The npm package akamaijs-sensor contained malicious code that executed arbitrary JavaScript via hidden Unicode-encoded bytes and established a command-and-control channel through a Google Calendar dead-drop. The package was designed to run attacker-authored code in the consumer's Node process when the sensor() API was called.
npmCompromised packageMalicious commit - resolvedcritical
Malicious code in @velliajs/discord (npm)
@velliajs/discord, a malicious npm package masquerading as a discord.js clone, contained two hostile mechanisms: an unpinned private git dependency with embedded GitHub PAT enabling arbitrary code injection on install, and a hidden runtime kill-switch that gates bot functionality based on a remote allow-list. Two live GitHub Personal Access Tokens were hardcoded in the package.
npmCompromised packageMalicious commit - resolvedcritical
Malicious code in akamaijs-sensorv1 (npm)
The npm package akamaijs-sensorv1, which advertises itself as an Akamai Bot Manager sensor generator, contains malicious code that executes hidden dynamic code and fetches remote instructions from a Google Calendar-based command-and-control channel. The package uses invisible Unicode characters to conceal executable code and establishes a covert remote-code execution sink controlled by an attacker-owned email account.
npmCompromised packageMalicious commit - containedcritical
Malicious code in @wololasod/tiny-id (npm)
The npm package @wololasod/tiny-id contained obfuscated malicious code that downloads and executes platform-specific remote executables on Windows and Linux systems. The dropper was embedded in both the main entry point (dist/index.cjs) and the TypeScript types file (dist/index.d.ts), disguised as a tiny ID generator.
npmCompromised packageMalicious commit