Malicious code in grammy-tools (npm)
- MAL-2026-21079
Description
grammy-tools@1.36.3 is a copy of the grammY Telegram bot framework with injected code in out/bot.js. An internal function addBotId() is invoked unconditionally from the Bot constructor, so merely constructing 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/authorized_keys, granting persistent remote SSH login to the installer's host. The same function retrieves the host's public IP from ipinfo.io and then issues an HTTPS request carrying the IP address, the OS username from os.userInfo() and the platform string to grammy.validator.blog (Linux) or grammy.validator.icu (other platforms), with errors silently swallowed. Package metadata copies the legitimate project's description, author and homepage (grammy.dev) while the shipped code differs, presenting the trojanized library as the real framework.
Text from the OSV record.
Recommendation
Remove the package and rotate any secret the machine that installed it could reach. There is no version to update to.
Affected
grammy-toolsnpm
No versions listed
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.