Skip to main content

Malicious code in py-2equests (PyPI)

0
Critical
Published: 09/03/2026 (09/03/2026, 17:01:50 UTC)
Source: GCVE Database
Product: py-2equests

Description

The py-2equests package on PyPI is a malicious typosquatting package impersonating the popular 'requests' library. When imported, it collects environment variables with keys starting with SECRET, API, TOKEN, or KEY and sends them to a configurable remote host and port. It also opens a reverse shell connection to the same destination, allowing remote code execution. The package version 0.0.1 is affected. The exfiltration target in analyzed versions was localhost, indicating possible testing rather than active widespread exploitation.

Affected software

PyPIghsa
py-2equests
Affected versions
=0.0.1

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

AILast updated: 09/07/2026, 16:08:52 UTC

Technical Analysis

py-2equests is a malicious Python package designed to impersonate the legitimate 'requests' library by substituting '2' for 'r' in the name. Upon import, it scans environment variables for sensitive keys and exfiltrates their values over a TCP socket to a host and port specified by environment variables (defaulting to 127.0.0.1:9999). It then spawns a subprocess that establishes a reverse shell connection to the same host and port, enabling remote shell access. The package self-documents its intent with comments and CLI messages. The only known affected version is 0.0.1. The exfiltration target being localhost suggests the package may have been used for testing or pentesting purposes rather than active malicious campaigns.

Potential Impact

Any process importing py-2equests version 0.0.1 will leak sensitive environment variables such as secrets, API keys, tokens, and credentials to a remote host controlled by an attacker. Additionally, it grants remote shell access to the attacker via a reverse shell, potentially allowing full control over the affected system. This poses a critical confidentiality and integrity risk to affected environments.

Defensive Guidance

No official patch or remediation is available for py-2equests since it is a malicious typosquatting package rather than a legitimate library. The best mitigation is to avoid installing or importing py-2equests and to verify package names carefully before installation. Remove any instances of py-2equests from environments and scan for unauthorized packages. Monitor for unexpected network connections to suspicious hosts. Since the exfiltration target defaults to localhost, verify no internal services are compromised. There is no vendor advisory or official fix; patch status is not applicable.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-15862
Osv Schema Version
1.7.4
Ecosystems
["PyPI"]

Threat ID: 6a9ad4f4acd9273b49b67989

Added to database: 09/04/2026, 14:25:56 UTC

Last enriched: 09/07/2026, 16:08:52 UTC

Last updated: 10/04/2026, 00:29:39 UTC

Views: 42

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses