Malicious code in pyyi (PyPI)
Description
The pyyi package on PyPI is a malicious package that impersonates the Python interpreter and executes remote code supplied by a command-and-control server. It registers console commands named after Python executables (e.g., python3.7) that shadow legitimate interpreters and send system information to an obfuscated server. The package fetches, decodes, decompresses, and executes arbitrary Python code in memory without any integrity checks. It also includes a fake Python REPL that captures single-token inputs as passwords and sends them to the attacker. This combination enables remote code execution and credential theft on affected systems.
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
The pyyi PyPI package masquerades as a cryptographic library but contains no legitimate cryptographic API. Instead, it installs console scripts named after Python interpreters (e.g., python3.7) that shadow real Python binaries on the system PATH and in common binary locations. When executed, these scripts send the hostname and OS to an obfuscated remote server, then fetch a base64-encoded, gzip-compressed Python payload which is executed in memory via exec without any signature or hash verification. The package also implements a fake Python REPL that disables terminal echo and sends single-token inputs as passwords to the attacker’s server, storing accepted credentials locally in an obfuscated form. The malicious behavior is confirmed by static and isolated dynamic analysis, although the actual server payload and its effects remain unknown. This constitutes installer-side remote code execution and credential theft.
Potential Impact
This malicious package enables remote attackers to execute arbitrary Python code on affected systems by supplying payloads from a remote server. It also captures user input in a fake REPL environment to steal credentials. The package shadows legitimate Python interpreters, increasing the likelihood of execution by users or automated systems. The lack of payload integrity verification means attackers can change the executed code at will, potentially leading to full system compromise or data theft.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately uninstall the pyyi package and remove any shadowed Python interpreter binaries installed by it (e.g., python3.7 in /usr/local/bin, ~/.local/bin, or local app data directories). Avoid installing packages from untrusted sources and verify package authenticity before installation. Monitor for unexpected Python executables on system PATH. Since no vendor advisory or patch information is available, patch status is not yet confirmed — check the vendor advisory or PyPI for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-17866
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["PyPI"]
Threat ID: 6ad7ec532cdf04f6566ba2d2
Added to database: 10/20/2026, 22:33:55 UTC
Last enriched: 10/20/2026, 22:45:03 UTC
Last updated: 10/20/2026, 22:45:03 UTC
Views: 5
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.
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.