Malicious Code Vulnerability in puregram: A Threat to PyPI Users
Summary
MAL-2025-6569: Malicious code in puregram (PyPI). Affects puregram versions 1.0.0. 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
puregram is a Python library designed for interacting with Telegram's API, enabling developers to create bots and automate tasks within the Telegram ecosystem. While it offers a range of functionalities, the library has been found to contain malicious code that poses significant risks to users who integrate it into their applications.
Vulnerability Detail
The vulnerability identified in puregram originates from a malicious code injection in version 1.0.0 of the package. This code can potentially compromise user data, allow unauthorized access, or execute harmful actions within the user's environment. The malicious nature of this vulnerability highlights the importance of scrutinizing third-party packages before integration, as it can lead to severe security breaches and data loss.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall puregram
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 puregram altogether until a secure version is released. Alternatively, if the functionality is critical, consider isolating the environment where puregram is used, ensuring that it has limited access to sensitive data and resources.
Conclusion
The discovery of malicious code in the puregram package underscores the importance of vigilance when using third-party libraries. Users are advised to take immediate action to mitigate risks by removing the affected version and monitoring for updates. Utilizing tools like Vulert can further enhance security by providing real-time alerts for vulnerabilities.
See every vulnerability recorded for puregram →
FAQ
The malicious code can compromise user data and allow unauthorized access to the system, posing significant security risks.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without any signup.
Remove the affected version and upgrade to a patched version if available. If not, consider using alternative libraries.
Always review third-party packages before integration, and consider using tools like Vulert to monitor for vulnerabilities.
Ignoring this vulnerability can lead to data breaches, unauthorized access, and potential damage to your application's integrity.