GHSA-94p9-xgh2-xp45: Pip/virtualenv vulnerability

Published Sep 30, 2026
·
Updated

downloadwheel() runs pip download and hands the result straight to the seeder, with nothing checking the bytes it gets back. The embedded pip and setuptools wheels carry a BUNDLESHA256 that virtualenv checks on every load, but a wheel fetched over the network for the periodic-update feature or the --download flag had no equivalent verification.

A compromised index, a stale mirror, or a MITM'd download (when TLS is intercepted, e.g. via a misconfigured or malicious CA) could substitute a different wheel under the same distribution/version/filename, and virtualenv would cache and seed it into every environment created afterward with no warning.

Fixed by computing the downloaded wheel's sha256 and comparing it against the digest PyPI's public JSON API reports for that exact release, independent of which index actually served the file. The check is skipped, not treated as failure, when a custom index (PIPINDEXURL, PIPEXTRAINDEXURL, PIPINDEX) is configured, since a private index can legitimately serve a different, intentionally rebuilt wheel. Fix: https://github.com/pypa/virtualenv/pull/3251

Affected Software

1 affected componentFixes available
pip/virtualenv<=21.7.11
21.7.12

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/virtualenv to a version that resolves this vulnerability.

    Fixed in 21.7.12
  2. Upgrade

    Upgrade virtualenv to a version that resolves this vulnerability.

    Patch 3251

Event History

Sep 30, 2026
Advisory Published
via GitHub·11:54 PM
Data Sourced
via GitHub·11:54 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which virtualenv workflows are exposed to this issue?

The issue affects wheels fetched over the network by the periodic-update feature or when using the --download flag. Embedded pip and setuptools wheels are checked against their bundled BUNDLE_SHA256 values and are not described as affected.

2

What access or conditions would an attacker need to exploit this?

An attacker would need to cause virtualenv to receive a substituted wheel from a compromised index, stale mirror, or an intercepted TLS download. The substituted file could use the same distribution, version, and filename as the expected wheel.

3

What is the impact after a substituted wheel is downloaded?

Virtualenv could cache the substituted wheel and use it to seed every environment created afterward. The vulnerable behavior provided no warning when this occurred.

4

Does the new digest verification protect installations using a private or custom package index?

No. The verification is skipped when PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, or PIP_INDEX is configured, because a private index may intentionally serve a rebuilt wheel with a different digest.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203