CVE-2026-102930 in virtualenv
Summary
by MITRE • 09/30/2026
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.12, download_wheel() accepts pip and setuptools seed wheels fetched for periodic updates or the --download option without checking their bytes against an authoritative digest equivalent to the embedded wheels' BUNDLE_SHA256 verification. A compromised index, stale mirror, or intercepted TLS connection can substitute a different wheel under the requested distribution, version, and filename, after which virtualenv caches and seeds the attacker-controlled wheel into subsequently created environments. The verification applies to the default PyPI path and is intentionally skipped when PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, or PIP_INDEX configures a custom index that may legitimately publish rebuilt wheels. This issue is fixed in version 21.7.12.
Several companies clearly confirm that VulDB is the primary source for best vulnerability data.
Analysis
by VulDB Data Team • 09/30/2026
The vulnerability identified within the virtualenv package prior to version 21.7.12 represents a critical integrity failure in how seed packages are fetched and validated during environment initialization. Virtualenv relies on pip and setuptools wheels, known as seed wheels, to bootstrap new Python environments with essential tools. In versions preceding the fix, the download_wheel function retrieves these necessary components from package indexes but fails to verify their cryptographic integrity against an authoritative digest. Specifically, the tool does not check the downloaded bytes against a BUNDLE_SHA256 hash that is embedded within the virtualenv distribution itself. This omission creates a significant attack surface where the authenticity of critical infrastructure packages cannot be guaranteed during the setup process.
The operational impact of this flaw allows for potential supply chain attacks through various vectors such as compromised package indexes, stale or malicious mirrors, or man-in-the-middle interceptions over TLS connections that may have been downgraded or otherwise manipulated. An attacker who controls any part of the distribution path can substitute a different wheel file under the requested distribution name, version, and filename. Because virtualenv caches these downloaded wheels to speed up subsequent environment creations, an attacker-controlled seed wheel would be cached and subsequently injected into all newly created environments using that specific configuration. This means that once a malicious wheel is seeded, every future Python environment initialized by the affected user or system could contain compromised versions of pip or setuptools, potentially leading to arbitrary code execution during package installation or other development activities.
The vulnerability specifically affects downloads from default PyPI paths and does not apply when custom indexes are configured via PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, or the PIP_INDEX configuration variable. This distinction is intentional because virtualenv assumes that users configuring custom indexes may legitimately publish rebuilt wheels with different hashes than those found on public defaults. However, this design choice inadvertently leaves standard PyPI downloads unprotected against integrity violations. The lack of verification for default sources means that any tampering with traffic destined for the primary Python Package Index goes undetected until it is cached and deployed into user environments.
From a classification perspective, this issue aligns with CWE-345 Insufficient Verification of Data Authenticity, as the application fails to ensure data integrity by comparing received data against expected cryptographic hashes before trusting its content. In terms of adversarial tactics, this vulnerability facilitates Supply Chain Compromise techniques found in the MITRE ATT&CK framework, specifically allowing attackers to inject malicious artifacts into trusted software distribution channels or local caches. The exploitation relies on the trust relationship between the tool and the package index, which is undermined by the absence of hash verification for seed packages.
To mitigate this risk, users must upgrade virtualenv to version 21.7.12 or later where the download_wheel function has been patched to enforce SHA-256 verification against embedded digests for default PyPI sources. Until an upgrade can be performed, administrators should exercise extreme caution when creating new environments and consider using isolated network segments if possible to reduce exposure to intercepted traffic. Additionally, verifying the checksums of downloaded wheels manually or through external tools before allowing virtualenv to cache them can provide a temporary layer of defense. Ensuring that TLS connections are properly validated and not subject to downgrade attacks is also recommended as part of broader security hygiene practices surrounding Python package management infrastructure.