Skip to content

✨ feat(release): publish a VEX for the embedded wheels - #3308

Closed
gaborbernat wants to merge 1 commit into
pypa:mainfrom
gaborbernat:feat/vex
Closed

gaborbernat wants to merge 1 commit into
pypa:mainfrom
gaborbernat:feat/vex

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

A scanner that reads the SBOM from #3299 finds pip 26.0.1 and setuptools 82.0.1 and reports eight OSV entries for pip and two for setuptools against every virtualenv install. BUNDLE_SUPPORT hands those versions to Python 3.9 environments only; 3.10 and newer get pip 26.2.1 and setuptools 84.0.0, which OSV lists nothing against. Nothing told users that, or that pip 26.1+ and setuptools 83+ require Python 3.10, so --pip and --setuptools cannot reach a fix on 3.9. 🔎

virtualenv.openvex.json carries one statement per advisory (GHSA-58qw-9mgm-455v, GHSA-jp4c-xjxw-mgf9, GHSA-wf93-45jw-7689, GHSA-qwm4-qh6w-59xr, GHSA-h35f-9h28-mq5c, each with its CVE and PYSEC aliases). I read each advisory and marked all five affected: virtualenv's own pip calls avoid some paths (it installs hash-checked wheels and passes --disable-pip-version-check), but a user of the 3.9 environment reaches every one of them with the seeded pip or setuptools, and when virtualenv itself runs on 3.9 its seed wheel download goes through the pip download --only-binary=:all: path GHSA-qwm4-qh6w-59xr describes. Each statement explains who is exposed and gives the action: create the environment for Python 3.10 or newer, plus a 3.9 mitigation where one exists. The products are pkg:pypi/virtualenv and pkg:generic/virtualenv.pyz, since the zipapp bundles the same wheels, and each names the bundled wheel by purl and SHA-256.

I picked OpenVEX over CycloneDX VEX because a CycloneDX VEX points at components through BOM-links to one SBOM serial number, and ours changes whenever the wheel content does. An OpenVEX statement names the product and the wheel by purl and hash, so the same file stays valid across releases and maintainers can update it between them. grype and trivy both read OpenVEX with --vex.

tasks/validate_sbom.py now checks the file in the readme env: it validates it against the OpenVEX 0.2.0 JSON schema, fetched from a pinned commit and checked by SHA-256, and fails when a statement names a wheel the built wheel does not bundle. An embedded wheel bump that drops pip 26.0.1 therefore fails CI until a maintainer updates the statements. The release workflow attaches the file in the same gh release create call as the other assets, which immutable releases require, and the verify job compares the asset with the file at the tagged commit. docs/development.rst says who updates it and when; the user-facing description goes into #3305.

@gaborbernat gaborbernat added enhancement security Fixes a vulnerability or hardens the supply chain, CI or release labels Sep 23, 2026
Scanners read the SBOM, find pip 26.0.1 and setuptools 82.0.1, and
report their advisories against every virtualenv install. Users had no
way to learn that only Python 3.9 environments get those versions, or
what to do about it.

Keep an OpenVEX document at the repository root with one statement per
advisory, validate it in the readme env against the OpenVEX schema and
the wheel's bundled hashes, and attach it in the single gh release create
call. OpenVEX identifies products by purl and hash, so the file survives
the per-release CycloneDX serial and maintainers can update it between
releases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement security Fixes a vulnerability or hardens the supply chain, CI or release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant