← Back to Pull requests

Explain legacy bundles in verify-blob errors #5276

Open
unknown opened this pull request with 206 lines diff across 2 files
View on GitHub
unknown unknown commented on Dec 03, 2026 21:55 UTC
Author

Summary

Resolves #5274

verify-blob and verify-blob-attestation read only Sigstore bundles on main. A legacy cosign bundle (base64Signature, cert, rekorBundle) fails with proto: (line 1:2): unknown field "base64Signature", which does not tell users that the format was dropped.

This adds loadBundleFromPath in cmd/cosign/cli/verify, used by both commands. If bundle.LoadJSONFromPath fails and the file is a legacy cosign bundle (a JSON object with only base64Signature, cert and rekorBundle, decoding as cosign.LocalSignedPayload), it returns:

<path> is a legacy cosign bundle; cosign v4 verifies only Sigstore bundles (legacy bundles were last supported in cosign v3): <original error>

Bundles that load are not affected; any other load error is returned as before. The check runs only on the error path.

To test: go test ./cmd/cosign/cli/verify/ -run 'TestLoadBundleFromPath|TestVerifyBlob$|TestVerifyBlobAttestationLegacyBundle', or run cosign verify-blob --bundle <legacy bundle> ... with a bundle from cosign v2 sign-blob --bundle. I also checked by hand that a v0.3 bundle still verifies.

AI disclosure: written with Claude Code (Claude Opus 5.5) and reviewed with OpenAI Codex (GPT-6.2 Sol); I reviewed every changed line and the tests.

Release Note

  • cosign verify-blob and cosign verify-blob-attestation now explain when a --bundle file is a legacy cosign bundle that cosign v4 no longer verifies, instead of failing with only a protobuf "unknown field" error.
  • Documentation

    None. No flags or help text changed.

    🤖 Generated with Claude Code

    Diff: 206 lines (+154 / -52) across 2 files Reviewer: cmurphy Review duration: 2182m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 206 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.319
    Real PR Conversation Timeline
    1 comments
    "Review active on #5276"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.4% (MEDIUM) · Higher = larger blast radius
    36.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.4% · Safe to merge
    19.4%