Malicious PyPI Pyrogram Forks Add Backdoor to Telegram Bot Servers

· Original article ↗

Summary

Checkmarx reports that Operation Navy Ghost published at least eight trojanized Pyrogram forks on PyPI. Their secret.py backdoor can run Python or shell commands with an infected bot’s permissions and access files, secrets, and Telegram data.

Key points

  • Checkmarx says the campaign published at least eight malicious Pyrogram forks on PyPI between November 2025 and June 2026.
  • A hidden secret.py file in the helpers module registers Telegram command handlers and activates when Pyrogram is imported or an infected bot starts.
  • The backdoor can execute attacker-supplied Python or shell commands under the infected application’s authority and return output through Telegram.
  • Researchers say the malware can read server files, access Telegram chats, retrieve databases and secrets, and install a persistent backdoor.
  • Checkmarx attributes the packages to one actor based on shared Telegram IDs in an OWNERS list, identical backdoor code, command names, and overlapping infrastructure.
  • Checkmarx advises developers who installed the packages to remove them, rotate affected server credentials, and revoke Telegram bot tokens.

Article Details

Attack Vectors
  • Trojanized Pyrogram forks published on PyPI contain a backdoor in the helpers module’s secret.py file.
  • The backdoor activates when Pyrogram is imported or an infected Telegram bot starts, and registers hidden Telegram command handlers.
  • The handlers execute attacker-supplied Python or shell commands on the compromised server and return command output through Telegram; larger output is sent as a document attachment.
Defensive Notes
  • Remove any of the listed malicious PyPI packages from affected environments.
  • Rotate credentials on affected servers and revoke their Telegram bot tokens.

MITRE ATT&CK

Malware

Products

Related Articles