Malicious PyPI packages give hackers control of Telegram bot servers
Since November 2025, a campaign has been distributing malicious forks of the Pyrogram Python library on PyPI targeting developers building Telegram bots. These trojanized packages contain a hidden backdoor that activates on infected bots, allowing attackers to execute arbitrary Python code or shell commands on compromised servers. The backdoor enables attackers to read arbitrary files, access Telegram chats, dump secrets, and install persistent backdoors. The malicious packages have been downloaded thousands of times, and the attacker controls infected bots via hardcoded Telegram IDs. Developers are advised to remove these packages, rotate credentials, and revoke Telegram bot tokens.
AI Analysis
Technical Summary
A threat actor published at least eight malicious forks of the Pyrogram Python library on PyPI between November 2025 and June 2026. These packages include a hidden backdoor module (secret.py) that registers Telegram command handlers to execute attacker-supplied Python code or shell commands on infected servers running Telegram bots. The backdoor allows reading arbitrary files, accessing Telegram client data, and exfiltrating information via Telegram messages. The attacker uses a hardcoded list of Telegram IDs for exclusive control and disables logging to operate stealthily. The campaign targets production Telegram bot environments to access sensitive infrastructure components. Checkmarx researchers attribute all malicious packages to a single actor based on shared code and infrastructure.
Potential Impact
Attackers gain remote code execution on servers running infected Telegram bots, enabling them to read any file, access Telegram chats and session data, dump secrets, download databases, and install persistent backdoors. This compromises the confidentiality and integrity of the affected servers and any sensitive data they hold. The backdoor operates with the same privileges as the infected application, potentially allowing full system compromise depending on the bot's permissions.
Mitigation Recommendations
No official patch exists as this is a supply chain malware campaign involving malicious PyPI packages. Developers should immediately remove any of the identified malicious Pyrogram forks from their environments. They must rotate all credentials on affected servers and revoke Telegram bot tokens to prevent further unauthorized access. Vigilance in verifying package authenticity before installation is critical to avoid similar supply chain threats.
Malicious PyPI packages give hackers control of Telegram bot servers
Description
Since November 2025, a campaign has been distributing malicious forks of the Pyrogram Python library on PyPI targeting developers building Telegram bots. These trojanized packages contain a hidden backdoor that activates on infected bots, allowing attackers to execute arbitrary Python code or shell commands on compromised servers. The backdoor enables attackers to read arbitrary files, access Telegram chats, dump secrets, and install persistent backdoors. The malicious packages have been downloaded thousands of times, and the attacker controls infected bots via hardcoded Telegram IDs. Developers are advised to remove these packages, rotate credentials, and revoke Telegram bot tokens.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
A threat actor published at least eight malicious forks of the Pyrogram Python library on PyPI between November 2025 and June 2026. These packages include a hidden backdoor module (secret.py) that registers Telegram command handlers to execute attacker-supplied Python code or shell commands on infected servers running Telegram bots. The backdoor allows reading arbitrary files, accessing Telegram client data, and exfiltrating information via Telegram messages. The attacker uses a hardcoded list of Telegram IDs for exclusive control and disables logging to operate stealthily. The campaign targets production Telegram bot environments to access sensitive infrastructure components. Checkmarx researchers attribute all malicious packages to a single actor based on shared code and infrastructure.
Potential Impact
Attackers gain remote code execution on servers running infected Telegram bots, enabling them to read any file, access Telegram chats and session data, dump secrets, download databases, and install persistent backdoors. This compromises the confidentiality and integrity of the affected servers and any sensitive data they hold. The backdoor operates with the same privileges as the infected application, potentially allowing full system compromise depending on the bot's permissions.
Mitigation Recommendations
No official patch exists as this is a supply chain malware campaign involving malicious PyPI packages. Developers should immediately remove any of the identified malicious Pyrogram forks from their environments. They must rotate all credentials on affected servers and revoke Telegram bot tokens to prevent further unauthorized access. Vigilance in verifying package authenticity before installation is critical to avoid similar supply chain threats.
Technical Details
- Article Source
- {"url":"https://www.bleepingcomputer.com/news/security/malicious-pypi-packages-give-hackers-control-of-telegram-bot-servers/","fetched":true,"fetchedAt":"2026-06-30T21:21:27.805Z","wordCount":907}
Threat ID: 6a44335727e9c7971968eb2c
Added to database: 06/30/2026, 21:21:27 UTC
Last enriched: 06/30/2026, 21:21:41 UTC
Last updated: 07/01/2026, 03:33:44 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.