You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[sec-check] Workflow-path fence: unmarked owner approval binds to the head commit's committer date #14754
Severity: medium Type: unsafe-pattern (authorization binding to attacker-controlled timestamp)
workflowFenceApproval (src/pkg/github/automerge/automerge_contributor_workflow_approval.go, added in #14672) releases the contributor lane's .github/workflows/** / .github/actions/** fence when a trusted merger approves the current head. For a typed /hive decision approve comment, or a dashboard /approve without a head marker, "current head" is decided by comment.created_at >= headPushedAt.
headPushedAt (automerge_head_age.go) was built for the min_head_age soak gate: while that window is open it prefers the head commit's committer date (HeadCommitPushedAt → commit.committer.date, floored only at PR created_at). That date is written by the pusher's git (GIT_COMMITTER_DATE), not by GitHub.
Impact
Sequence on a contributor-lane PR that touches workflow files:
Trusted merger types /hive decision approve on benign head A.
Before the lane merges, the contributor pushes head B (different workflow content) with a committer date earlier than the approval comment.
While B's observed age is inside min_head_age, headPushedAt(B) returns the backdated committer date, the step-1 comment now post-dates it, the fence is released for B, and the lane merges B under the App's workflows: write — workflow changes nobody approved.
The APPROVED-review path (bound by commit_id) and marker-bearing dashboard approvals are not affected. Default toggle owner_approval_releases_workflow_fence is on.
Recommendation
Bind unmarked approvals to a server-side time the pusher cannot move: the PR updated_at pinned on the head's first observation (HeadFirstSeenTracker.observe), never the commit's committer date. Keep headPushedAt unchanged for the soak gate. An approval older than the observed head should leave the fence armed, like a review on a stale commit.
Decision taken by hive: fail-closed on the pinned observation time (a hive restart can only over-hold, and the merger re-approves) rather than querying the timeline API for push events.
Activity
docs(automerge): say unmarked approvals bind to the first-observed he…
🐛 fix(automerge): bind unmarked owner approvals to the head's observe…