Malicious Code Exploit in smtblib: A Threat to Telegram Users
Summary
MAL-2025-192579: Malicious code in smtblib (PyPI). Affects smtblib versions 0.1.8. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
smtblib is a Python package available on PyPI that is designed to provide functionalities related to Telegram. However, a malicious version of this package has been identified, which poses significant risks to users by executing harmful code during initialization. This vulnerability allows attackers to collect sensitive information, particularly targeting Telegram session files.
Vulnerability Detail
The vulnerability originates from a malicious copy of a standard library module within the smtblib package. Upon class initialization, this version downloads and executes remote code from a specified IP address (87.120.107.132). The executed code is designed to collect and exfiltrate sensitive Telegram session files. Furthermore, the malicious code attempts to cover its tracks by overwriting itself with non-malicious code after execution. This campaign shares infrastructure and methods with previous malicious campaigns, indicating a broader threat landscape.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall smtblib
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary measure, users can avoid using the smtblib package until a secure version is released. Additionally, monitoring network traffic for any suspicious activity related to the specified IP address (87.120.107.132) can help mitigate risks.
Conclusion
The smtblib package has been compromised with malicious code that poses a significant threat to users, particularly those using Telegram. Immediate action is required to uninstall the affected package and monitor for updates. Users are encouraged to utilize tools like Vulert for ongoing vulnerability management.
See every vulnerability recorded for smtblib →
FAQ
smtblib is a Python package designed for functionalities related to Telegram. However, a malicious version has been identified that poses security risks.
The vulnerability allows attackers to execute remote code that can collect sensitive information, particularly Telegram session files, leading to potential data breaches.
Immediately uninstall the smtblib package using pip uninstall smtblib and refrain from using it until a secure version is released.
Currently, there is no patched version available. Users should monitor the official PyPI repository for updates.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities in your software. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.