Malicious Code Vulnerability in statsapi Package - Exfiltration of Host Information
Summary
MAL-2025-191878: Malicious code in statsapi (PyPI). Affects statsapi versions 0.0.0 – 1.7.2. 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
The statsapi package, available on PyPI, is designed for statistical data handling in Python applications. However, it has been identified as malicious, containing code that exfiltrates sensitive information from the host system, such as IP addresses and usernames. This vulnerability poses a significant risk to users who unknowingly install the package, as it serves no legitimate purpose other than data theft.
Vulnerability Detail
The vulnerability originates from the package's design, where it overrides the install command in setup.py to execute malicious code during installation. This code is responsible for exfiltrating basic data from the system, leading to potential privacy breaches. The package has been categorized under PROBABLY_PENTEST, indicating it mimics typical penetration testing tools but carries a risk of data exposure.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
pip uninstall statsapi
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, avoid using the statsapi package until a secure version is confirmed. Regularly monitor the package repository for updates and consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The statsapi package has been identified as malicious, posing a risk of data exfiltration upon installation. Users are advised to uninstall the package and monitor for updates or alternatives. Utilizing tools like Vulert can help in identifying vulnerabilities in your software.
See every vulnerability recorded for statsapi →
FAQ
The statsapi package is a Python library intended for handling statistical data, but it has been compromised to include malicious code.
The malicious code executes during installation, exfiltrating sensitive information such as IP addresses and usernames from the host system.
Uninstall the package immediately using pip uninstall statsapi and monitor for any updates or patches.
Yes, consider using other statistical libraries that do not have known vulnerabilities, such as pandas or NumPy.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time using just the Pipfile.lock. Check your application for vulnerabilities at Vulert Scanner without needing to sign up.