Skip to content

babysit unattended merge: settle #7335 security residuals before Phase 15 #7339

Closed

Description

@kyle-sexton

Refs: #7335, #6202

The security review of #7335 (Phase 13, unattended merge connect) found four items that were not fixed in that PR. The unattended merge path stays inert until Phase 15 adds the merge: block, so each one must be fixed or accepted as a named residual before Phase 15 enables it.

  1. P3: promotion evidence paths are not checked for writability. The binding, probe root, evidence source and checker are not checked; only the settings files are. resolve-promotion-evidence.mjs gets no --worktree-root paths, so a sibling worktree passes the check, and _lane_writable does not check ancestor directories. Exposure depends on how the operator configures the host.
  2. P4: the post-merge check reads the default branch, but the policy uses base_ref. An unattended merge into a non-default branch that has a merge queue is never read back. Fix: refuse --unattended when the base is not the default branch, or pass branch=base_ref.
  3. P4: the rule that the author and head pushers must not be human has gaps. Author emails not linked to an account on non-force pushes are not excluded. The PR author can also apply the opt-in and class labels. This is within write-access trust. Decide: document it as a named residual, or close the gap.
  4. P5: blocking text from any commenter dequeues the identity's entry. This fails closed, so it is denial of service only. Decide: accept it, or require is_human.

Done when every item is fixed or recorded as an accepted residual in the Phase 15 change.

🤖 Generated with Claude Code

Activity

  1. added
    needs-triage
    on Oct 12, 2026
  2. github-actions commented on Oct 12, 2026

    @github-actions
    Contributor

    Thanks for the report. Automated triage handed this issue to a maintainer.

    Automated triage. A maintainer reviews it.

  3. added
    needs-human
    on Oct 12, 2026
  4. kyle-sexton commented on Oct 12, 2026

    @kyle-sexton
    MemberAuthor

    Update from #7335 at 7cb2e1e:

    • Item 2 closed: the unattended path now refuses any base that is not the default branch (base-not-default:<ref>).
    • Added: a C3 rung needs a blast-radius rating source before any C3 PR can score LOW; today C3 stays fail-closed at MED and is refused as class-above-rung at C2.
    • Added: narrow the convention-YAML tab and CR check (scripts/check-convention-yaml.sh:79) to the policy file or its values.
    • Added: unify the two merged-history walks (in-flight and post-merge) into one function; this needs the policy-to-postmerge import cycle broken first.
  5. kyle-sexton commented on Oct 12, 2026

    @kyle-sexton
    MemberAuthor

    Local security review of #7335 increment 1b27674..7cb2e1e (it stood in for the security lane, which ended incomplete). No P1 or P2. Settle these before Phase 15:

    • P3 (opt-in label check-then-use): _opt_in_hold (babysit_merge_policy.py:1432-1444) sees only label changes after the enqueue. A removal, or a removal followed by a bot re-add, between the eligibility read and the enqueue goes unseen. Fix: re-read the opt-in, presence and provenance, beside the second kill-switch read in unattended_enqueue, or always run _label_provenance on the latest labeled event.
    • P4: a later run that scores the PR's own queued entry MED or HIGH does not dequeue it. Add risk:<score> to that entry's holds.
    • P4: base-not-default is not an own_refusal, so an identity entry already queued on a non-default base stays queued. Set own_refusal for it.
    • P4 (existing code): dequeue_identity_entries (babysit_postmerge.py:843-848) stops at the first failed mutation. Try each entry and collect the failures.
    • P4 (design, same as the pr-pipeline: inputs from the 2,000-PRs effort, and the local-lane work waiting on deployed lanes #6202 Q21 constraint): _label_provenance cannot tell the operator from an agent using the operator's own gh token. Name it as a residual, or keep the operator write token out of agent sessions.
    • P5 (existing code): _identity_queue_entries passes the branch with -F (babysit_merge.py:2916), which reads @path and coerces values. Use -f.
  6. added theissue type on Oct 12, 2026
  7. removed
    needs-triage
    on Oct 12, 2026
  8. kyle-sexton commented on Oct 12, 2026

    @kyle-sexton
    MemberAuthor

    From #7338 (Phase 14) at 196677a. Residuals accepted there; Phase 15 should confirm each stays acceptable:

    • R4: lane detection in push-branch.sh fails open to the operator path when the gh viewer read fails. The Phase 15 credential-only lane host is the real control.
    • The lane base repository comes from gh repo view, which can follow the checkout's remotes. Exploiting it needs write access to .git.
    • Proxy and CA environment variables are not scrubbed by lane-push.sh, so whoever controls the lane environment can observe the gh token.
    • R3: a lane on an operator host with SSH_AUTH_SOCK or ~/.ssh keys reachable can push as the operator. Verify the lane launcher environment before Phase 15.
    • Behavior change: attended push-branch.sh --pr now accepts only github.com remotes (https, ssh://[email protected]/, [email protected]:). SSH host aliases are refused.
  9. self-assigned this
    on Oct 13, 2026
  10. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    This was generated by AI during backlog shaping.

    Closing as completed. Done when 'every item is fixed or recorded as an accepted residual' is met on origin/main: #7352 fixed items 1, 2 (via #7335), 4 and the head-pusher part of 3, recorded the label gaps as named residuals, and fixed every follow-up from the 2026-10-12 comments. The #7338 residuals are recorded as R1-R6 in the loop-lane README, and the unattended merge path has since been enabled (#7773).

    Evidence:

    The owner approved this close in an attended backlog-shaping session on 2026-10-18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs-human

Type

Fields

No fields configured for Task.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions