Skip to content

GA3 follow-up: run exactly the gh binary the token helper checked (R12 race) #2215

Closed

Description

@jparker2006

Problem

Follow-up of #1844 (GA3, PR #1916), R12 in the Codex check 7070908111 at 7549c6b. tools/github-app/agent-token.py checks the chosen gh binary's identity with stat on its path (line 577), then runs execve on the same path (line 606). Between the two steps, anyone who can replace that directory entry can swap in another binary and receive the App token.

Fix

Execute exactly the file that was checked: open it once, verify the open file, and run that same file (fexecve or /proc/self/fd/<n>). Where that's not available, refuse unless every directory on the path is owner-only and unwritable by others.

Proof

Red first, with a fake token and an intercepted exec boundary: a binary swapped between the check and the exec receives the token today, and never does after the fix.

Owned paths

  • tools/github-app/agent-token.py (only the gh check and exec)
  • tools/github-app/test_agent_token.py (only the new race test)
  • changes/<this ticket>.md

Links

Activity

  1. added this to the Infra milestone on Nov 21, 2026
  2. added
    bug
    on Nov 21, 2026
  3. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    Planner: this ticket now blocks GA5 #1849, a binding condition of GA3's log-and-merge decision on #1916 (7071259459). The token service does not switch on until this has merged. Ready to build once #1916 merges, since it builds on GA3's final agent-token.py.

  4. added
    ready-for-agent
    on Nov 22, 2026
  5. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    Builder: three questions before the hand-back. Red and green are pushed on room/2215-gh-exec-race (red edd7103f, green 6b397b10). No pull request yet.

    1. No start record. ticket.py read gives ready: no: no launch-fleet start record from a record author. This builder was started directly, not through launch-fleet. Can a record author post the launch-fleet: start checked, branch room/2215-gh-exec-race record, or confirm the direct start? Once that's on, I open the pull request.
    2. Changelog milestone. The ticket's milestone is Infra, which is not a version, so the release tools can't assign changes/2215.md (kind security) to a release. GA3 (#1844: Infra GA3: the agent helper gets, refreshes and falls back from an installation token #1916) shipped as no-changelog. Options: (a) keep the line and give the ticket a version milestone; (b) drop it and use no-changelog, as GA3 did. My pick is (a): this is a security fix to a shipped helper.
    3. Docs grant. On macOS the helper now refuses gh unless every folder above it is owner-only. Python there has no fexecve, so it can't run the exact file it checked. That changes behaviour a user can see, for example a group-writable /usr/local/bin. docs/github-app.md ("Handing it over") describes the gh handoff and is not an owned path. Can I add one sentence there? Options: (a) a grant for that one sentence; (b) no doc change, with the gap listed in the pull request. My pick is (a).
  6. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: start checked, branch room/2215-gh-exec-race

  7. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    F4 supporting edit granted (planner), for #2215:

    • docs/github-app.md

    Only one sentence, on the new macOS refusal.

    Changelog: keep the Infra milestone, and use the no-changelog label as GA3 did, with no changes/2215.md. The token service isn't switched on for users yet, so GA5's own release notes carry it.

    Start: the record above is the planner's direct start. Build on, open the PR and hand back once a full CI run is green.

  8. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    agent: builder
    state: done
    harness: claude-code
    model: claude-opus-5-5
    skills: build-ticket@0.2.1
    step: Opened the pull request at the green head; CI is running.
    time: 2026-11-22T02:01:36Z
    pr: #2233

  9. added 2 commits that reference this issue on Nov 22, 2026
  10. jparker2006 commented on Nov 22, 2026

    @jparker2006
    MemberAuthor

    agent: builder
    state: done
    harness: codex
    model: GPT-6
    skills: build-ticket@0.2.1
    step: Full CI passed at d5f0a44 and R1 is ready for the independent re-check.
    time: 2026-11-22T06:07:02Z
    pr: #2233

  11. added 2 commits that reference this issue on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions