MAL-2026-21079

See a problem?
Import Source
https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/grammy-tools/MAL-2026-21079.json
JSON Data
https://api.osv.dev/v1/vulns/MAL-2026-21079
Published
2026-12-03T20:39:57Z
Modified
2026-12-03T20:45:08Z
Summary
Malicious code in grammy-tools (npm)
Details

-= Per source details. Do not edit below this line.=-

Source: amazon-inspector (d5870674dd6e0d3e174cc4f50ab60ae364830b6a08a9bfd9387f1977529dbec9)

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.

Database specific
{
    "malicious-packages-origins":  [
        {
            "id":  "IN-MAL-2026-023228",
            "import_time":  "2026-12-03T20:41:50.725198344Z",
            "modified_time":  "2026-12-03T20:39:57Z",
            "sha256":  "d5870674dd6e0d3e174cc4f50ab60ae364830b6a08a9bfd9387f1977529dbec9",
            "source":  "amazon-inspector",
            "versions":  [
                "1.36.3"
            ]
        }
    ]
}
References
Credits

Affected packages

npm / grammy-tools

Package

Affected ranges

Affected versions

1.*
1.36.3

Database specific

cwes
[
    {
        "cweId":  "CWE-506",
        "description":  "The product contains code that appears to be malicious in nature.",
        "name":  "Embedded Malicious Code"
    }
]
indicators
{
    "evidence_files":  [
        {
            "path":  "out/bot.js",
            "sha256":  "646e9661c279c68b696471181047a1b16d577f440488d97636bd6fb750a65fe9",
            "tlsh":  "34c2b58e67f71537056364a8ab1b2061e331c11f2379e9947d8d83b42f427344ab6bfa"
        },
        {
            "path":  "package.json",
            "sha256":  "3fa281448508d40dfba18d9d759b4cff5e378d74316d81b6f7e6d38eb61b983c",
            "tlsh":  "d3313319c5ba4da306d63568ec2d4242a224814baca8fc093bcc427e4f4cc6f90fd38e"
        }
    ],
    "package_integrity":  [
        {
            "filename":  "grammy-tools-1.36.3.tgz",
            "hashes":  {
                "sha1":  "1ac88cd93158ac9cec582ef3f61f0c03e3488330",
                "sha512_sri":  "sha512-04GZMoVjc9FbZmG9fFx9A/dQ7uUJWrdHx9X/yyxLBzqEDiN4emUSFiPU37YCGFPcr01M7FH8UX0pHegDsgxh1A=="
            }
        }
    ]
}
source
"https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/grammy-tools/MAL-2026-21079.json"