A supply-chain attack has been targeting Python developers building Telegram bots since at least last November. Attackers uploaded trojanized forks of the legitimate Pyrogram library to the PyPI package repository, disguising them as legitimate dependencies.
The malicious packages, which masquerade as trusted code libraries, are designed to evade detection by closely mimicking legitimate Pyrogram versions. Once installed, they grant attackers the ability to read arbitrary files on compromised servers.
The campaign exploits the trust developers place in open-source repositories like PyPI. The malicious forks, likely installed inadvertently via dependency confusion or typosquatting, contain hidden code that establishes a backdoor on the host system.
After infection, the backdoor allows threat actors to exfiltrate sensitive data, including API keys, credentials, and configuration files stored on the server. The attack chain does not require direct interaction beyond the initial package installation.
Developers are advised to verify package hashes against official sources and audit their project dependencies for suspicious Pyrogram variants. The PyPI registry has not yet issued an official advisory, but users should immediately review any recent Pyrogram installations since November.