Repository navigation
π fix: require verified signature for email-only hive commit identity match - #15405
Conversation
β¦atch Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Security review β changes requested (in-scope).
1. verified attests the committer's signature, not the author's email β the author-side email-only match is still forgeable (src/pkg/github/pr_merge_state.go:113-122, head 978e89e)
verified is read once for the whole commit (:113) and then applied to both identities via byHive (:114-117), including the author path at :122. GitHub's verification only binds the signing key to the committer email (reason bad_email = "doesn't match the committer email"); the author fields are free text. So a fork contributor with any GPG/SSH key registered on their own account can do git commit -S --author="x <anyone@<pane-domain>>" (an address with no GitHub login, since hiveCommitIdentity at src/pkg/github/pr_signed_reconcile.go:316-326 accepts any local part in the domain): committer path fails (login = contributor), author path gets login == "", hive domain, verified == true β CommitByHive returns true. driveRebaseMerge (src/pkg/dashboard/rebase_merge_followthrough.go:228-234) then sets HeadByHive, treats the foreign head as the rebase, and MergePRVia merges it under the operator's recorded approval (:248-250). This is the same foreign-head bypass #15182 asks to close, with one extra flag (--author) β so the contract is not met.
Fix: don't let the committer's verification satisfy an author-only email match. Either drop the email-only branch for the author (author must resolve to the App bot login; hive-produced heads β fixer rebase or update-branch β already pass via the committer), or require the committer to also be a hive identity before trusting an email-only author. Add a case to pr_merge_state_commit_by_hive_test.go: committer login alice + verified: true, author {login: "", email: quality@<pane-domain>} β want false (the current table at :22-28 always uses the same identity for author and committer, so it can't catch this).
The committer-side change itself is sound: a verified signature on a pane-domain committer email requires that address to be verified on the signer's GitHub account, i.e. domain ownership β the intended trust boundary.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Correctness (read at head 978e89e)
Medium β the verified gate does not cover the author-only path. GitHub marks a commit verified when its signature matches a key on an account whose verified email equals the committer email; the author field is not checked. In src/pkg/github/pr_merge_state.go:113-123 the same verified flag is reused for the author fallback: a fork contributor with commit signing enabled can push git commit --author="x@<pane-identity-domain>" β the committer path fails (login resolves to the person, pr_signed_reconcile.go:316-319), but the author path has login == "", a pane-domain email, and verified == true, so line 123 returns true and rebase_merge_followthrough.go:228-235 sets HeadByHive. This is exactly the forged-user.email scenario #15182 describes, narrowed to signers rather than closed.
Suggested fix: trust the author-only fallback only when it resolves to the App bot login (i.e. drop the email-only author branch, or require verified && committer also hive, which the committer check at line 120 already returns). Legitimate hive heads (fixer rebase, update-branch) have the hive as committer, so no known path depends on the author-only match.
Test gap (pr_merge_state_commit_by_hive_test.go:21-28): author and committer always share one identity; add a case with committer login alice + author email-only in the pane domain + verified: true and assert false.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
GitHub's signature verification binds the signing key to the committer address alone, so a verified commit says nothing about the author field. Keep the verified-email fallback for the committer and require the author to resolve by login to the App bot; cover author/committer split identities in the table test. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Security re-review at bd947ed β prior findings fixed; approve.
- Fixed:
src/pkg/github/pr_merge_state.go:116-121appliesverification.verifiedonly to the committer email-only match;:127accepts the author solely by a login resolved to the App bot (hiveCommitIdentityatpr_signed_reconcile.go:318-319rejects any other resolved login). Tests now split author/committer and cover forged--authorinto the pane domain / bot noreply (pr_merge_state_commit_by_hive_test.go:33-34).
Out-of-scope (pre-existing at merge-base pr_merge_state.go:110-113, not widened here): the author-by-login path (:127, codified by test bot login author, web-flow committer, unverified β true) trusts GitHub's emailβlogin resolution, which is itself derived from the free-text author email. A pusher who sets user.email to the App's ID+name[bot]@users.noreply.github.com address gets author.login resolved to the bot and passes CommitByHive on an unsigned commit. Consider requiring verified (or a web-flow/bot committer) on the author path too, as backlog.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether the rebase-then-merge follow-through may fail foreign-head on every fixer rebase of a contributor PR (fixer commits are unsigned by construction and the reconcile signer skips non-App-authored PRs), or whether #15182's verified-signature requirement needs a signing step on that path first.
The code does what #15182 asked, and the table test covers the identity matrix well. But reading the callers, I believe the tightened check closes the main path it is meant to protect.
Mechanism (verified in the tree at v5):
pkg/dashboard/rebase_merge_followthrough.go:228callsCommitByHivefor every new head on a contributor PR (!f.HiveAuthored), andpkg/rebasemerge/rebasemerge.go:255-259turnsHeadByHive == falseinto a terminalFailForeignHead.- The documented producer of that new head is the fixer lane's rebase (
operator-reference.md:475, same row this PR edits: "otherwise the fixer lane"). The fixer pushes plain git under the pane identity β the committer email is in the pane domain and GitHub resolves no login for it, which is exactly the email-only case this PR now gates onGetVerification().GetVerified()(pr_merge_state.go:118). - Those commits are unsigned by construction: the push broker pins
commit.gpgsign=falseon every brokered git call (src/crux/pushbroker/pushbroker.go:89). The only thing that signs hive commits after the fact is the reconcile pass inpr_signed_reconcile.go, and it skips any PR whose author is not the App bot (pr_signed_reconcile.go:169) β a contributor's PR is never walked.
So for a contributor PR routed to the fixer, the rebased head is email-only and unverified β CommitByHive returns false β the follow-through settles failed (foreign-head) with nothing merged, on every attempt. The one case this still passes is GitHub's own update-branch (committer login = App bot), which the row says is used only when the PR is merely behind.
The new test's "person author, email-only pane committer, verified β true" row (pr_merge_state_commit_by_hive_test.go, the "fixer's rebase" comment) encodes the intended path, but nothing in the tree produces a verified commit there.
I am not saying the requirement is wrong β #15182 chose it deliberately as reversible β only that as merged it would need either (a) the fixer's rebase push to go through signBranch (as pr_request_signed.go:86 does at open time), or (b) the reconcile pass to also walk PRs with an armed follow-through. That is a merge-policy/trust call, so I am routing rather than judging it.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed (correctness) β no blocking findings at bd947ed.
The change does what #15182's approved recommendation asked (src/pkg/github/pr_merge_state.go:115-127), the table test covers the login/email/verification matrix, and the only production caller (src/pkg/dashboard/rebase_merge_followthrough.go:228 β rebasemerge.Advance, rebasemerge.go:254-260) fails closed as intended.
One advisory, not a blocker: the email-only + verified β hive branch (pr_merge_state.go:119) is practically unreachable. GitHub only reports a commit Verified when the signing key belongs to an account whose verified email is the committer address β which also resolves rc.GetCommitter().GetLogin(), so the committerLogin != "" arm fires first. Agents can't sign at all (src/docs/github-app-setup.md:184). In effect the rule is now "a pane-domain email alone never counts"; the fixer's rebase is still recognised only because App-installed hives commit with the bot's noreply address, which GitHub links to the bot login (src/crux/agent/manager_env.go:174-178). A hive whose bot user-id lookup fails (falls back to <agent>@<domain>, gitidentity.go:19-29) will now settle its own fixer rebase as foreign-head. That is the fail-closed outcome the issue chose and is reversible, so fine to land; the doc comment's "the fixer's rebase" wording for the pane-domain case is just slightly generous.
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @bd947ed, 61/62 checks green, 1 pending, DCO yes, soak 0s of 30m0s. What to do: approve this head ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
There was a problem hiding this comment.
Looks correct to me, and it fails closed in the direction #15182 asked for (decision recorded by @clubanderson: "go with the recommendation").
What I verified at 393a120:
src/pkg/github/pr_merge_state.go:141-153: thecommitterLogin != ""short-circuit is safe becausehiveCommitIdentity(src/pkg/github/pr_signed_reconcile.go:316-320) only returns true for a non-empty login when it equals the App bot β a person login with a pane-domain email never reaches the email branch, so the new guard cannot be bypassed by a resolved human login. The table case "person login, verified" pins this.- Author path (
pr_merge_state.go:153) now reduces to "author login == App bot", which is exactly the update-branch shape and nothing else; the email-only author route (the forgeable one) is gone. hiveCommitIdentityitself is untouched, so the signed-reconcile pass that walks App-authored PRs with unsigned heads keeps its current behaviour.- The red "Sign-off survives the squash" in the rollup is a cancelled run (41015483383) superseded by a successful run on the same head (41015490265); not a real failure.
One consequence worth a maintainer's eye, already stated in the PR body and the operator-reference row: the fixer's plain-git rebase of a contributor PR (unsigned, email-only pane committer) now settles foreign-head instead of merging. That is the intended trade for closing the forged-user.email hole, and reversible, but it means the dirty-contributor-PR path of rebase-then-merge effectively needs the fixer host to sign its pushes before it is useful again.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should dismiss or refresh the CHANGES_REQUESTED review at 3513f96 β head 393a120 now carries only the four CommitByHive files that review asked to keep.
The split you asked for at 3513f96 has happened: this head touches only src/pkg/github/pr_merge_state.go, src/pkg/github/pr_merge_state_commit_by_hive_test.go, changelog.d/changed-15182.md and src/docs/operator-reference.md. pr_fixer_rebase_signed.go is no longer in the PR. Your CHANGES_REQUESTED is still the recorded review decision and is what keeps this blocked.
On the code itself (read at 393a120): hiveCommitIdentity (pr_signed_reconcile.go:316-335) returns true for a non-empty login only when it equals the App bot login, so the new gate at pr_merge_state.go:142-146 resolves to exactly the stated rule β a bot-login committer counts as before, an email-only pane/noreply committer additionally needs GetVerification().GetVerified(), and pr_merge_state.go:152-153 lets the author count only by a resolved bot login. The 13-case table test exercises each branch, including the forged---author and update-branch shapes. Looks correct to me.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1
There was a problem hiding this comment.
HUMAN DECISION NEEDED β @clubanderson's CHANGES_REQUESTED review at 3513f96 still gates this PR (reviewDecision: CHANGES_REQUESTED, mergeStateStatus: BLOCKED) although head eb2f843 carries only the four files that review asked to keep; dismiss or refresh it so the merge can proceed.
Intent alignment, delta re-review 393a120 β eb2f843. The delta is a single Merge branch 'v5' bringing in #15694 (docs/repositories.md +4/β2, security-insights.yml +11/β3) β neither file is in the PR's diff, and the four PR files (src/pkg/github/pr_merge_state.go, src/pkg/github/pr_merge_state_commit_by_hive_test.go, src/docs/operator-reference.md, changelog.d/changed-15182.md) have identical blob SHAs at both heads. No new PR code to judge against #15182.
Prior finding Stale CHANGES_REQUESTED blocks a head that already did the requested split: still present β pr_fixer_rebase_signed.go and the rebase_merge_followthrough.go hook remain absent at head, matching item 1 of the 3513f96 review ("Keep the CommitByHive verified-signature tightening β¦ + its test + changelog/doc line"), but the review state has not been updated. Nothing agent-fixable remains in scope.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether to accept that, after this lands, Rebase-then-merge on a dirty contributor PR settles failed (foreign-head) until the fixer host signs its pushes with a key GitHub verifies against a pane-domain address.
Decision needed: @clubanderson should decide whether to accept that, after this lands, Rebase, then merge as maintainer on a dirty contributor PR settles failed (foreign-head) until the fixer host signs its pushes with a key GitHub verifies against a pane-domain address.
The code does what it says and I found no defect; I am routing it because it changes merge-trust policy and knowingly disables one operator flow.
What I verified against the v5 tree:
hiveCommitIdentity(src/pkg/github/pr_signed_reconcile.go:316-335) already returns false for any resolved login other than the App bot, so the new author clauseauthorLogin != "" && hiveCommitIdentity(...)reduces to "GitHub resolved the author to the App bot". The committer clause keeps login-resolved-to-bot as before and gates the email-domain / noreply-address path onverification.verified. Net effect is a strict tightening β nothing that was rejected before is accepted now.- The reasoning that GitHub's verification binds to the committer address, not the author, is correct; that is why the forged-
--authorcases inpr_merge_state_commit_by_hive_test.goreturn false while "person author, email-only pane committer, verified" returns true. - GitHub's update-branch (author = App bot, committer =
web-flow) still passes via the author clause, so the hive's own behind-only PRs are unaffected. - The regression is real and the PR documents it in both the doc comment and
operator-reference.md:482: the fixer's rebase is a plain unsigned commit (push broker setscommit.gpgsign=false; the signed reconciler walks App-authored PRs only), so on a contributor PR the follow-through now fails closed and Approve the new head & merge is the only way through. Whether that trade is acceptable before the fixer signs is the owner's call, not mine.
Changelog fragment changed-15182.md is present. Could not run go test in this pod (blocked for agents); the test (rest β¦) shards are green on this head.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read against the tree at 5b1b3f0. The tightening is implemented as described and fails closed in the right direction.
- The
committerLogin != ""short-circuit atpr_merge_state.go:145is safe becausehiveCommitIdentity(pr_signed_reconcile.go:318-319) only returns true for a resolved login when it equals the App bot β a person's resolved login never reaches that branch, so "any login" here really means "the App bot". - Author-side:
authorLogin != "" && hiveCommitIdentity(...)at:154means email-only author matches are dropped entirely, which is the right call since GitHub's verification covers the committer identity only. - Consequence to be aware of (stated in the new doc comment at
:119-123, not a defect): the sole caller is the rebase-then-merge follow-through (rebase_merge_followthrough.go:255), so an unsigned plain-git fixer rebase on a contributor PR now reportsHeadByHive=falseand the follow-through settles foreign-head instead of merging. That is the reversible, keep-work-moving option @clubanderson chose on #15182, so I am not raising it as a question.
go build ./pkg/github/ ./pkg/dashboard/ is clean. Looks correct to me. The conflicts-with-open-pr label is the only thing standing between this and green from what I can see.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 100-merge-queue β 060-reviewed: required-check-pending:Sign-off survives the squash |
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether to accept that, with this change, "Rebase, then merge as maintainer" on a dirty contributor PR settles failed (foreign-head) after the fixer's unsigned rebase until fixer hosts sign their pushes β the price of no longer trusting a bare pane-domain committer email.
Conclusion: the code is correct and closes a real gap; I found no defect. I am routing it because it is a merge-trust policy change that knowingly regresses one operator path, and that trade is a maintainer's to accept.
The gap it closes (read at head a68a98d):
src/pkg/github/pr_signed_reconcile.go:316-327βhiveCommitIdentity("", email)returnstruefor any address in the pane domain, by string match alone. Git author/committer emails are set by whoever pushes (git -c user.email=x@<pane-domain>), so onv5a person pushing a new head after a maintainer's rebase-then-merge click could have it counted as the hive's rebase (pr_merge_state.go:131), merging content the approval never covered.src/pkg/github/pr_merge_state.go:141-153(this PR) β an email-only committer match now also requirescommit.verification.verified; GitHub only marks a commit verified when the signing key's account owns the committer email, so the domain match is finally bound to a GitHub identity. Author matches by email are dropped entirely (:152), which is right: a signature says nothing about the author field. The 13-case table inpr_merge_state_commit_by_hive_test.gocovers both forgeries and both legitimate shapes (update-branch, signed fixer rebase).
What it costs β stated by the PR itself, verified: the fixer's rebase of a contributor PR is a plain unsigned commit with a pane-domain committer (the PR body and operator-reference.md:482 say the push broker sets commit.gpgsign=false, and the signed reconciler only re-signs App-authored PRs). Under the new rule that head fails CommitByHive, so the dashboard follow-through in src/pkg/dashboard/rebase_merge_followthrough.go settles failed (foreign-head) instead of merging, and the maintainer must click Approve the new head & merge. That is a deliberate fail-closed choice, not a bug β but it changes what a merge-now click does on every dirty contributor PR until fixer hosts sign.
The automerge DCO path is unaffected: automerge_stage_dco.go:79-81 already uses commitByApp (login only) and does not call this function.
Changelog fragment and operator-reference row both describe the new rule and the prerequisite accurately.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Reviewed β no findings from this perspective.
Delta a68a98dβ¦7088ec12 is only the v5 merge of #15621 (pr_empty_diff_hive_autoclose.go, its test, changelog fragment); no PR-authored code changed. Prior security note (src/pkg/github/pr_merge_state.go:144, merge-trust policy change with accepted operational regression) no longer applies: the maintainer decision is on record in this PR (clubanderson, 2026-10-30T01:45Z: keep the CommitByHive verified-signature tightening, drop the signing step), and the PR now matches that shape β email-only committer match fails closed without verification.verified, author counts only by App-bot login (pr_merge_state.go:148-164).
β hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #15182
Why
The maintainer decision on #15182 was "go with the recommendation; where options remain, take the one that keeps work moving and is reversible". The recommendation from PR #15104's review rounds: when
CommitByHivematches the hive's identity by email domain alone (GitHub resolved no login for the committer/author), also require GitHub's commit verification flag.What
src/pkg/github/pr_merge_state.go:CommitByHivenow requiresrc.GetCommit().GetVerification().GetVerified()for an email-only committer match. A committer whose login resolves to the App bot counts exactly as before. The author counts only by a login resolved to the App bot (GitHub's update-branch under the App): a signature binds the key to the committer address only, so no email-only author match counts.hiveCommitIdentityis unchanged, so the signed-commit reconcile pass (which handles unsigned commits by design) is unaffected. Doc comment updated.src/pkg/github/pr_merge_state_commit_by_hive_test.go: new table test β email-only + verified β hive; email-only + unverified / no verification block β not hive; bot noreply email-only + unverified β not hive; App bot login + unverified / no verification β hive (unchanged); person committer + hive-domain author email, verified β not hive; update-branch shape (App bot author login,web-flowcommitter) β hive.src/docs/operator-reference.md: the rebase-then-merge row states the verified requirement for the email-only match and its operational prerequisite (below).changelog.d/changed-15182.md.No existing test fixture needed adjusting (there were no prior
CommitByHivetests;TestHiveCommitIdentityis untouched). Reversible by dropping theverifiedcondition.Scope note
Per maintainer review on this PR, the hive must not force-update a contributor's head branch, so no signing step for fixer rebases is included (an earlier head carried one; cba6d4b removed it). Consequence, now stated in the operator-reference row and the
CommitByHivedoc comment: the fixer's plain-git rebase of a contributor PR is an unsigned, email-only pane committer (the push broker setscommit.gpgsign=false; the signed reconciler only walks App-authored PRs), so on adirtycontributor PR the follow-through settlesfailed(foreign-head) unless the fixer host signs its pushes with a key GitHub verifies against a pane-domain address. Approve the new head & merge on the fixer's head is the way out until then. Update-branch (behind-only) under the App is unaffected.β hive: agent=scanner backend=copilot model=claude-opus-5.5