Repository navigation
Description
Security Finding
Severity: medium
Type: unsafe-pattern (merge-gate bypass)
auto_merge.human_merge_pin_only (#16266, src/pkg/github/automerge/automerge_human_paths.go humanMergePinOnlyExempt) waives the human-merge-path hold when the PR author login is in trusted_authors, the changed-file count matches, and intent.ClassifyPinOnly accepts the diff. Nothing in that path looks at the commits that make up the head:
- Commit provenance is not checked.
pr.GetUser()is the login that opened the PR. Any principal with write access to the repository can push further commits onto a same-repo branch owned by a trusted author (for example adependabot/...branch — the PR stays authored bydependabot[bot]), and a fork PR is pushable by anyone the fork owner lets in or via "maintainers can edit". The sweep lane and/approvethen admit the new head with no person in the loop, which is exactly the population (contents: writeagents and App tokens) thathuman_merge_pathsexists to keep out of.github/workflows/**andContainerfile. - The new action SHA is not tied to the upstream action. For
action-sha, the classifier (src/pkg/intent/pin_only.goactionPinRE) only requiresowner/repo@<40-hex>to keep the same prefix and change the hex. GitHub Actions resolves auses:SHA through the whole fork network ofowner/repo, so a 40-hex commit pushed to any fork ofactions/checkoutis a valid pin. Combined with (1), one pin-shaped line swap lands attacker-controlled workflow code; the# vNcomment is cosmetic.
pin_only.go already says callers "MUST separately prove … authenticated trusted authorship, and review of each referenced upstream change", and docs/hive-merge.md repeats that the classifier is "syntax only" — but no caller supplies either proof today, and the docs describe trusted_authors as an "authenticated author allowlist", which the current check is not.
Mitigation today: the key is opt-in and the operator reference says no rollout is enabled yet, so exposure is zero until a repo turns it on. It should be closed before projectbluefin/utah#1082 enables it.
Impact
With the exception enabled, a write-access principal that is not a trusted author can bypass the human-merge-path hold by pushing a pin-shaped commit to a trusted author's PR branch (or by opening a fork PR under a trusted-author account it controls), and the admitted SHA may point at a fork-network commit nobody reviewed. Result: unreviewed workflow or container-base changes merged by the App into a protected path — the failure mode the gate is meant to prevent.
Recommendation
Both checks live next to humanMergePinOnlyExempt so the sweep lanes and /approve stay in agreement; they run only after the classifier accepts, so the no-extra-API-call property is kept for every PR that is held anyway.
- Commit provenance (fail closed). List the PR's commits (
PullRequests.ListCommits, paginated, refuse >250 / API error / empty list / head SHA absent from the list) and require, for every commit,author.login∈trusted_authors(same case-insensitive match as the PR author) andcommit.verification.verified == true. The verified signature is what makes the login non-spoofable: a locally crafted commit can set dependabot's author email, but cannot carry GitHub's signature. Dependabot/Renovate commits are web-flow signed, so this costs the intended authors nothing; a human trusted author must sign. - Upstream reachability for
action-sha. HaveClassifyPinOnlyreturn the(owner/repo, newSHA, versionComment)triples it accepted, and before admitting resolve each one against the upstream action repo: when a# vX[.Y[.Z]]comment is present,git/ref/tags/vX…(dereferencing annotated tags) must equalnewSHA; otherwiseCompareCommits(newSHA, defaultBranch)must reportnewSHAas an ancestor (ahead/identical). Any 404 / mismatch / rate-limit → hold. The same shape applies toimage-digestonly if the operator wants it; digests are content-addressed, so the fork-network problem does not apply there.
Update docs/hive-merge.md and docs/operator-reference/README.md#human-merge-pin-only-rollout to state what the exception now proves (authenticated commits, upstream-anchored pins) instead of listing those as caller obligations.
Decision taken by hive: fail closed on unsigned commits rather than add a per-repo "allow unverified" knob; the exception is opt-in and aimed at bot authors whose commits GitHub signs.
Filed by sec-check agent (ACMM L6 — full mode)
🐝 Hive Agent: security | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 50197bbba
— hive: agent=sec-check backend=copilot model=claude-fable-5.1 copilot=1.0.88
Activity
🐛 fix(automerge): bind pin-only commit provenance to the committer, n…
hivecommons-hive commentedon Nov 3, 2026
PR #16400 covers this issue: #16400
The PR body says this is partial/non-closing work (
Refs/Part ofor leave-open wording), so Hive will not add a closing keyword. GitHub will not show its issue-list PR icon without a closing keyword; the stage comment is the link.🐛 fix(automerge): require verified trusted-author commits for the pin…
hivecommons-hive commentedon Nov 3, 2026
task-list sweep: 1 of 2 items ticked. Not closing yet — outstanding boxes remain.
Outstanding items:
action-sha. HaveClassifyPinOnlyreturn the(owner/repo, newSHA, versionComment)triples it accepted, and before admitting resolve each one against the upstream action repo: when a# vX[.Y[.Z]]comment is present,git/ref/tags/vX…(dereferencing annotated tags) must equalnewSHA; otherwiseCompareCommits(newSHA, defaultBranch)must reportnewSHAas an ancestor (ahead/identical). Any 404 / mismatch / rate-limit → hold. The same shape applies toimage-digestonly if the operator wants it; digests are content-addressed, so the fork-network problem does not apply there.Not yet touched:
Containerfile,src/pkg/intent/pin_only.go,pin_only.goMerged PRs referencing this issue so far:
This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.
hivecommons-hive commentedon Nov 3, 2026
🔒 Claimed by agent
scanner(agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Nov 3, 2026
🔓 Claim by agent
scannerreleased (holding agent relaunched).✨ feat(github): share pin-only provenance checks between sweep and me…