Repository navigation
OpenSecret: let Cosign verify a full-size EIF in the Dev release statement run - #1667
Merged
Merged
Conversation
…ement run The first real Dev run signed its statement with the KMS key and then failed while verifying it: `cosign verify-blob-attestation` refuses to hash a blob over 128 MiB by default, and the Dev EIF is 234,302,194 bytes. `attest-blob` has no such limit, so the signature and its log entry were made before the failure. The verify call now sets COSIGN_MAX_ATTACHMENT_SIZE to the 2 GiB bound that prepare already enforces on the EIF. In Cosign v3.1.4 this is the only size check on that command's blob path. Co-Authored-By: Claude <[email protected]>
w3irdrobot
approved these changes
Nov 20, 2026
w3irdrobot
left a comment
Contributor
There was a problem hiding this comment.
Looks right. I also ran the pinned Cosign v3.1.4 offline against a 234,302,194-byte file with the script's arguments: it fails with that exact size error by default and gets past the size check with COSIGN_MAX_ATTACHMENT_SIZE set. Our tests only ever used a small file, which is how this got through.
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.
The first real Dev run (44637021964, attempt 2) signed its statement with the Dev KMS key and then failed in the same step, while verifying what it had just signed:
cosign verify-blob-attestationrefuses to hash a blob over 128 MiB unlessCOSIGN_MAX_ATTACHMENT_SIZEraises the limit, and the Dev EIF is 234,302,194 bytes.attest-blobreads the file with no such check, so the signature and its transparency-log entry were made before the failure. Nothing was retained, published or pushed.Change
cosign_verifysetsCOSIGN_MAX_ATTACHMENT_SIZEtoMAX_EIF_BYTES(2 GiB), the boundpreparealready enforces on the EIF. All three verifications (after signing, before upload, after read-back) go through this one call.COSIGN_*variables as well.Checked
cmd/cosign/cli/verify/verify_blob_attestation.go:173is the only size check on this command's blob path (the other callers are OCI paths). The limit is read fromCOSIGN_MAX_ATTACHMENT_SIZEwithhumanize.ParseBytes, which accepts a plain byte count.python3 -m unittest discover -s scripts/ci -p 'test_*.py'in the dev shell: 664 pass.Not checked
Alternative
--digestand--digestAlgwith the script's own SHA-256 would keep Cosign from reading the EIF at all. I kept the blob so Cosign still hashes the real file.After this merges
Re-running the failed run would use the old script. Dispatch
OpenSecret Dev release statementonmasteragain with the same build run ID,44636648269. It signs the same statement a second time, so the Dev key will have two log entries for it.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.