Repository navigation
[python] Fix Sigstore verification for Python 3.14+ - #1771
Open
Venkumahanti Subhankar (V-Subhankar-infy) wants to merge 13 commits into
Open
Venkumahanti Subhankar (V-Subhankar-infy) wants to merge 13 commits into
Venkumahanti Subhankar (V-Subhankar-infy) wants to merge 13 commits into
Conversation
Venkumahanti Subhankar (V-Subhankar-infy)
requested a max review from Copilot
November 10, 2026 10:29
Copilot started reviewing on behalf of
Venkumahanti Subhankar (V-Subhankar-infy)
November 10, 2026 10:29
Venkumahanti Subhankar (V-Subhankar-infy)
requested a max review from Copilot
November 10, 2026 11:52
Copilot started reviewing on behalf of
Venkumahanti Subhankar (V-Subhankar-infy)
November 10, 2026 11:52
Venkumahanti Subhankar (V-Subhankar-infy)
requested a lite review from Copilot
November 11, 2026 10:20
Copilot started reviewing on behalf of
Venkumahanti Subhankar (V-Subhankar-infy)
November 11, 2026 10:20
Venkumahanti Subhankar (V-Subhankar-infy)
requested a lite review from Copilot
November 11, 2026 12:06
Copilot started reviewing on behalf of
Venkumahanti Subhankar (V-Subhankar-infy)
November 11, 2026 12:06
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
A human assessment is warranted because the new source-verification policy is documented in NOTES.md but not reflected in the corresponding README, leaving the user-facing documentation incomplete.
No open issues 🎉
5 resolved since last review
Review effort: Lite
Venkumahanti Subhankar (V-Subhankar-infy)
marked this pull request as ready for review
November 11, 2026 16:51
Venkumahanti Subhankar (V-Subhankar-infy)
requested a review
from a team
as a code owner
November 11, 2026 16:51
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fix Python 3.14+ Sigstore verification
Fixes #1764
Problem and root cause
.sigand a nonexistent.peminstead of Python.org's.sigstorebundle.-fand--fail-with-bodyflags, while2>/dev/nullhid curl's diagnostic.The bottom 4 are straightforward implementation fixes. The first involves a much bigger architectural decision around security versus long-term sustainability while deciding how the cosign verifies the identity. ( cosign verifies the authenticity and integrity of downloaded Python source archives )
Approaches considered
The signer policy and Cosign verifier both need a trust decision. Dynamic lookup reduces manual maintenance but relies more on external sources; static values offer more repository control but need regular upkeep.
The practical options are:
Chosen approach
Resolve the Python release-manager identity and OIDC issuer from Python.org's published metadata, then verify the Python
.sigstorebundle against those exact values.Use Cosign v3.1.4 as a temporary, architecture-specific, checksum-verified bootstrap. Resolve the latest stable Cosign v3 release at build time and verify its binary and Sigstore bundle with the pinned bootstrap, using the Cosign release identity and issuer. Use the newer binary only after verification succeeds; otherwise retain the pinned binary. If the newer binary cannot verify the Python bundle, retry with the pinned verifier.
The pinned v3.1.4 hashes come from official GitHub release metadata. This version is newer than the one affected by GHSA-fx35-mq7g-6g98 and remains the trust anchor for updating the verifier.
Cache the binaries and Python.org signer policy across Python installations in the same build, then remove the cache on exit.
Preserve the existing non-blocking policy: if signer lookup, Cosign bootstrap/update, or Python bundle verification cannot complete, emit a warning and continue without verified source authenticity or integrity. A Python checksum fallback does not provide source authentication.
Cosign maintenance
The installer resolves the latest stable Cosign v3 release at build time, so the verifier does not need a manual version bump for every release. Review the pinned bootstrap version and hashes about quarterly (roughly 5–10 minutes per review), and update them promptly if a security advisory affects the pin or compatibility requires it. Check the Cosign security advisories and Cosign releases.
Cosign v3.1.4 is the pinned bootstrap and addresses the legacy-bundle verification issue covered by GHSA-fx35-mq7g-6g98. When updating the bootstrap, change the version and hashes for all supported architectures together.
Changes
src/python/install.sh: Add Python.org signer-policy lookup and exact-identity bundle verification; use pinned Cosign v3.1.4 to authenticate the latest stable Cosign v3 before use, with pinned-verifier fallback. Cache temporary binaries and signer metadata, retry transient downloads, and clean up on exit. Installgawkwith the required packages.src/python/devcontainer-feature.json: Bump the feature version from 1.8.1 to 1.9.0.src/python/NOTES.md: Document source verification and its failure policy.src/python/README.md: Update the generated feature documentation to match the notes.test/python/sigstore_verification_test.sh: Add mock-based checks for signer selection, Cosign arguments, supported architectures, checksum/download/signature failures, unsupported inputs, and cache cleanup.PR description.md: Record the problem, design decisions, impact, and verification status.Impact
Python 3.14+ source builds verify the release manager's identity and signature when verification succeeds. The GPG verification flow for Python versions before 3.14 remains unchanged.
The pinned bootstrap and dynamically verified Cosign binary are temporary; neither installs nor replaces a system-wide Cosign installation. The build needs GitHub access to obtain the Cosign release and Python.org access for signer metadata and bundles.
For compatibility, unsupported architectures, unknown signers, network failures, checksum mismatches, and signature failures still allow installation to continue with an explicit warning. Such builds do not have verified source authenticity or integrity.
Tests and verification
ubuntu:latest(26.04, amd64) with Python 3.14.10 completes successfully. The first.sigstoredownload times out, but the retry succeeds. Cosign reportsVerified OKwith the dynamically resolved signerhugo@python.org, and the CLI reportsoutcome: success.ubuntu:latest(26.04, amd64) with Python 3.14.10 completes successfully. The first.sigstoredownload times out, the retry succeeds, and Cosign reportsVerified OKforhugo@python.org; the CLI reportsoutcome: success.