grammy-tools (npm) · Malicious Code
Affects grammy-toolsSource GCVE Database
Malicious package : remove grammy-tools and rotate any secrets on hosts that installed it.
Data as of 4 Dec 2026, 00:03 UTC
Malicious package
Published to npm · OSV MAL-2026-21079
What to do
Remove grammy-tools from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| npmgrammy-tools | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
The grammy-tools npm package version 1.36.3 is a trojanized copy of the legitimate grammY Telegram bot framework. It contains malicious code that, when a bot is constructed, unconditionally executes a function that on Linux systems creates an ~/.ssh directory if missing and appends an attacker-controlled SSH public key to ~/.ssh/authorized_keys. This grants persistent remote SSH access to the compromised host. Additionally, the malware collects the host's public IP, OS username, and platform information, sending these details to attacker-controlled domains. The package metadata mimics the legitimate project to evade detection.