Malicious code in py-0requests (PyPI)
Description
The py-0requests package on PyPI is a malicious typosquatting package impersonating the popular 'requests' library by replacing the letter 'o' with the digit '0'. Upon import, it exfiltrates environment variables with keys starting with SECRET, API, TOKEN, or KEY to a TCP server, defaulting to localhost. It also establishes a reverse shell connection to the same destination, enabling remote control. The package does not provide any HTTP client functionality and appears designed for testing or pentesting purposes, as the exfiltration target is localhost. Only version 0.0.1 is known to be affected.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
py-0requests is a malicious PyPI package that uses homoglyph typosquatting to impersonate the legitimate 'requests' package. Its __init__.py code, executed on import, scrapes environment variables with sensitive prefixes and sends them over a TCP socket to a host and port specified by environment variables (defaulting to 127.0.0.1:9999). It also spawns a subprocess that opens a TCP connection to the same host/port, sends a 'SHELL' marker, and maintains the connection to provide a reverse shell to an operator. The package's CLI banner states it targets 'requests' but it contains no HTTP client API. Analysis indicates the exfiltration target is localhost, suggesting a low-harm or pentesting context. The only known affected version is 0.0.1.
Potential Impact
If imported, this package can exfiltrate sensitive environment variables and establish a reverse shell, potentially allowing remote code execution by an attacker controlling the specified TCP endpoint. However, the default exfiltration target is localhost, indicating limited risk unless the attacker controls the local machine or the environment variables TS_HOST/TS_PORT are set to an external host. No known active exploitation in the wild has been reported.
Mitigation Recommendations
Avoid installing or importing the py-0requests package. Use the legitimate 'requests' package from PyPI. Since no official patch or fix exists for py-0requests (it is a malicious package rather than a vulnerability in a legitimate package), remediation involves removing the package and auditing environments for its presence. No vendor advisory or patch is available. Monitor for and block typosquatting packages in supply chain processes.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-15860
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["PyPI"]
Threat ID: 6a9ad4f4acd9273b49b6799e
Added to database: 09/04/2026, 14:25:56 UTC
Last enriched: 09/07/2026, 16:08:29 UTC
Last updated: 10/04/2026, 01:33:03 UTC
Views: 46
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.