Prevent silent attestation downgrade on gem push - #9825
Open
hsbt wants to merge 3 commits into
Open
Conversation
On GitHub Actions the push tests inherited the real variable, took the auto-attestation path, and spawned `gem exec sigstore-cli` subprocesses. Scrubbing it in setup also made the host and engine skip guards decide nothing, so those tests now set it themselves. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub Actions documents the variable as "true", so any other value, including "false", should not trigger the auto-attestation path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The whole attested push was wrapped in rescue StandardError. A failure to read a file given to --attestation printed a warning and published the gem unattested with exit 0, and a network error after the server may have accepted the multipart push retried it unattested, letting an on-path attacker strip attestations by cutting the first connection. Only the opportunistic auto-signing step falls back now. attest! also returned just the tempfile path, so GC could unlink the bundle before it was read, which fell into that same rescue. Each bundle is now validated as a JSON object before it is sent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hsbt
force-pushed
the
push-attestation-downgrade
branch
from
August 31, 2026 05:48
5aad204 to
9ce35a5
Compare
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.
gem pushwrapped the whole attested push inrescue StandardError. A failure to read a file given to--attestationprinted a warning and published the gem unattested with exit 0, contradicting the comment right above that branch. The same rescue covered the HTTP POST, so a read timeout after the server had already accepted the multipart push retried it unattested, which also lets an on-path attacker strip attestations by cutting the first connection.Only the opportunistic auto-signing step falls back now. Errors from an explicit
--attestationabort the push, and the request stays outside the rescue.Three smaller problems from the same review are fixed here too.
attest!returned only the tempfile path, so GC could unlink the bundle before it was read.ENV["GITHUB_ACTIONS"]was tested for truthiness instead of against"true". Attestation bundles were concatenated into a JSON array unvalidated. The test helper also scrubsGITHUB_ACTIONS, which was making CI spawn realgem exec sigstore-clisubprocesses.#9325