Repository navigation
feat(cli): verify a minisign signature in uteke upgrade (#1327) - #1462
Merged
Merged
Conversation
…grade (#1327) Embed the release public key and verify checksums-sha256.txt.minisig over the raw checksums bytes before trusting any hash. The trusted comment must be 'uteke <tag>' so an older signed release cannot be replayed. A missing or invalid signature is a hard failure; UTEKE_UPGRADE_SKIP_CHECKSUM skips it too, with an updated warning.
…hive download (#1327) Compare versions numerically (semver, pre-release aware) and refuse an older release; unparseable tags are an error. Fetch and authenticate the checksums before downloading the archive, through a fail-closed authenticate_checksums. New fixtures: legacy signature, trailing-space and double-space trusted comments (the throwaway key was regenerated; all fixtures re-signed).
…osign pre-check (#1327)
…ash from verified checksums only (#1327) Reject any non-stable target tag (pre-release, build metadata, malformed) before the prompt and any download, with no override. A pre-release running binary can still upgrade to a newer stable. The expected archive hash now comes from verified_expected_hash, which authenticates the checksums first, and is unit-tested. Adds the whitespace-only signature case.
…eds a cosign bundle (#1327)
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Oct 15, 2026
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.
What
Stage 2 of #1327.
uteke upgradenow authenticates the release before it trusts anything in it.uteke upgrade(crates/uteke-cli/src/commands/upgrade.rs)checksums-sha256.txtandchecksums-sha256.txt.minisig(4 KiB cap), verifies the signature over the raw checksums bytes, then reads the expected hash from those same verified bytes. All of this happens before the archive download.minisign-verify0.3.0 (one new crate, no dependencies of its own) against the embeddedRELEASE_PUBLIC_KEYS, withallow_legacy=false.uteke <tag>. The crate authenticates the trusted comment through the global signature (checked against its source and by experiment), so one release's signed files cannot be served as another's.vX.Y.Z. Pre-release suffixes and build metadata are refused before any download. GitHub's/releases/latestalready excludes pre-releases; this enforces it in code too.latestmust be strictly newer than the running version by semver (numeric, pre-release ordering per semver); older is refused, equal is "already up to date". A running pre-release or dev build may upgrade to a newer stable.UTEKE_UPGRADE_SKIP_CHECKSUM=1still skips the checksum and now the signature too, with an updated loud warning. It does not skip the stable-tag or downgrade checks.Offline signing (owner signs, never CI)
scripts/sign-release.sh vX.Y.Zdownloads the checksums and the cosign bundle, runscosign verify-blobagainst the release workflow identity and aborts if it fails or is missing. It shows the verified checksums, asks y/N, signs with minisign (minisign prompts for the password itself; the script never reads it), verifies againstscripts/uteke-release.pub, then uploadschecksums-sha256.txt.minisig. It supports--dry-runand--force.scripts/uteke-release.pubholds the public key (key id96924B76E31B048B). The secret key is password-protected and stays on the owner's machine.Docs: SECURITY.md, AGENTS.md (new release step 6),
docs/install.md,docs/cli-reference.md, CHANGELOG.Why
#1327: the checksums came from the same release as the archive, so they only detected corruption. Someone who could replace release assets could replace both. With a signature made by a key that never lives on GitHub, replacing assets is no longer enough.
Decisions by the owner: minisign with an embedded public key, signed offline; fail closed; stable releases only; no downgrades. Cosign keyless stays for manual verification per SECURITY.md.
Testing
cargo test --workspace --locked: all pass (uteke-cli 135 unit + integration tests).cargo fmt --all -- --checkandcargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo audit: no vulnerabilities (the 2 allowed warnings were already there).cargo run -p docgen && git diff --exit-code docs/: no diff.Cargo.lock: the diff is only theminisign-verifyentries (7 lines);cargo build --lockedworks.minisign -V.verified_expected_hashnever yields a hash without a valid signature, and returns the exact hash for the archive name from a verified file.authenticate_checksumsfails closed on fetch errors.0.9.0<0.10.0,rc.2<rc.10, pre-release < release), unparseable tags, and the stable-only cases.bash scripts/tests/sign-release.test.sh: 13 checks with stubghandcosignand a throwaway key. They cover failing cosign, a missing bundle, a missing cosign, answering n, an existing signature, a bad tag, an unknown flag, and the--dry-runhappy path that signs and verifies without uploading. It is not wired into CI because no existing job fits cheaply; the command is in AGENTS.md step 6.Rollout notes
uteke upgradefails closed for any release without a.minisig. That includes v0.21.0 and the window between a release being tagged and the owner runningsign-release.sh. The signature check runs before the archive download, so that window wastes no 128 MiB download.uteke upgradeonly.install.sh,install.ps1and Homebrew do not verify it (Homebrew relies on the formula SHA256s).