Supply chain · pip · High
Malicious py-venv-doctor (PyPI) Exfiltrates Environment Variables
Threat Engine Auto-Feed · data current as of 2026-09-20
The 'py-venv-doctor' package version 0.1.0 on PyPI contains malicious code that exfiltrates all environment variables during installation and after generating a healthcheck report. This poses a critical risk for credential and secret theft from any system where it was installed.
- Package: pip / py-venv-doctor
- Affected versions: = 0.1.0
- Severity: critical
- Reach: unknown
- Exposure: 65/100 (High)
What happened — Credential / secret theft
The 'py-venv-doctor' package, specifically version 0.1.0, was found to contain malicious code. During its installation process and subsequent generation of a healthcheck report, the package collects and transmits 'opt-out telemetry' that includes the full set of system environment variables. This action is considered malicious due to the unauthorized exfiltration of potentially sensitive data.
How the attack works
This is a supply-chain attack where a seemingly legitimate software package is compromised to include malicious functionality. The attack leverages the package's installation routine, specifically by overriding the 'install' command in 'setup.py', to execute code that gathers and transmits sensitive environment variables. This type of attack aims to steal credentials, API keys, or other secrets stored as environment variables.
Who's exposed
Profiles most at risk
- Development teams using the PyPI ecosystem
- CI/CD pipelines that automatically pull Python dependencies
- Systems administrators managing Python environments
- Any user or system that installed 'py-venv-doctor' version 0.1.0
Conditions that increase exposure
- Unpinned or loosely versioned dependencies that allow pulling the malicious version
- Lack of dependency lockfiles (e.g., requirements.txt with exact versions)
- Automated build systems that install dependencies without manual review
- Internal package mirrors that have synchronized the malicious version
Blast-radius scenarios
- An attacker gains access to sensitive credentials, API keys, or other secrets stored as environment variables on the compromised system.
- The exfiltrated data could be used to pivot to other systems or services accessible from the compromised environment.
- Compromise of developer workstations or build servers leading to further supply chain attacks.
What to do (defensive)
Detect
- Review dependency trees for 'py-venv-doctor' version 0.1.0 in all Python projects.
- Monitor network traffic for unusual outbound connections from build systems or development environments after package installations.
- Scan existing Python environments for the presence of the malicious package.
- Implement software composition analysis (SCA) tools to identify known vulnerable or malicious packages.
Contain
- Immediately quarantine or isolate any systems identified with 'py-venv-doctor' version 0.1.0.
- Block network egress from development and build environments to untrusted external destinations.
- Remove the malicious package from all affected environments.
- Update package allowlists/blocklists to prevent re-introduction of the malicious package.
Remediate
- Rotate all credentials, API keys, and secrets that were present as environment variables on any system where 'py-venv-doctor' version 0.1.0 was installed.
- Rebuild affected environments from trusted sources, ensuring the malicious package is not included.
- Enforce strict dependency version pinning (e.g., using `==` in requirements.txt) and utilize lockfiles.
- Implement a robust software supply chain security strategy, including dependency integrity checks and runtime monitoring.
Frontier verdict — High
Prioritize immediate detection and removal of 'py-venv-doctor' v0.1.0 and rotation of all potentially exposed credentials due to critical credential theft risk.
Sources
For detection-engineering and awareness only · point-in-time · not security advice · sourced from the GitHub Advisory Database.