grammy-tools npm malware: trojanized grammY copy adds SSH backdoor and exfiltrates host details (no CVE)
Severity: critical · Patch status: no-fix-needed · Since 2026-12-03
The npm package grammy-tools@1.36.3 is a trojanized copy of the grammY Telegram bot framework with injected code in out/bot.js. An addBotId() function runs unconditionally from the Bot constructor, so merely instantiating a bot triggers it. On Linux it creates ~/.ssh if missing and appends a hardcoded attacker-controlled ssh-rsa public key (comment 'sshconf') to ~/.ssh/authorizedkeys, granting persistent remote SSH access. It also fetches the host's public IP from ipinfo.io and exfiltrates the IP, OS username and platform to grammy.validator.blog (Linux) or grammy.validator.icu, silently swallowing errors. Package metadata mimics the legitimate project (description, author, homepage grammy.dev). No patched version exists; the package is flagged as malware (CWE-506) by GitHub, Amazon Inspector and OpenSSF.
What to do
- Remove grammy-tools@1.36.3 from all projects and dependency trees immediately
- Audit ~/.ssh/authorized_keys on affected Linux hosts for the 'sshconf' key and remove it; rotate SSH keys and credentials
- Treat affected hosts as compromised: review SSH login history, rotate credentials, and rebuild if possible
- Block domains grammy.validator.blog and grammy.validator.icu at egress
- Use the legitimate grammY package (grammy.dev) and verify dependency integrity going forward
Sources
All live incidents on Threat Watch