Skip to content

fix(lanes): read-only cache and no id-token in jobs that run PR code #8294

Closed

Description

@kyle-sexton

Problem

Lanes that run PR code start on main via workflow_dispatch. GitHub states such runs keep a write-capable cache token, while runs from outsider triggers get a read-only one. Several of these workflows also grant id-token: write in the job that runs PR code: pr-review-hosted.yml, pr-run-activity-read.yml, work-resolve-issue.yml, pr-refine.yml and pr-merge.yml.

  • What an attacker needs: code in a lane PR. The one current path for outside text is the issue lane's web-access: domains: any.
  • Impact: poisoned entries in main's build cache. Security researchers (not GitHub) report that with sudo, any step can read the job's secrets from runner memory. setup-runner-isolation already removes sudo where it runs.

Fix

For every job that runs PR code: set cache-mode: read, drop id-token: write, and mint App or OIDC tokens in a separate job.

Exception (owner decision 2026-11-01, Q1 (a)): pr-run-activity-write.yml's run job keeps id-token: write. It mints the lane App token, then checks out the PR head and runs the model in the same job, the residual ADR 0058 accepts: the broker mints once per job, and probe P7 found no OIDC request variables in the model's Bash. Splitting that job is not required to close this issue.

Every other id-token: write in the workflows named above sits in a job that runs no PR code (pr-run-activity-read.yml broker-check, pr-merge.yml merge and enable-auto-merge, which check out main only), or on a caller's uses: of a lane runner, which only caps the callee: pr-run-activity-read.yml's head-code run job grants only contents: read and pull-requests: read. pr-review-hosted.yml grants none. So the write runner's run job is the one exception.

Priority

Low to medium. Deferred by the owner until the lanes run steadily; it must not break the lanes.

Basis: GitHub Security & Cost interview, Q6 (2026-10-18).

Activity

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

    @github-actions
    Contributor

    Proposed work class: none

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

    Unconfirmed model suggestion: work-class: scoped
    Basis: automated intake triage; a maintainer confirms or changes it.

    Automated triage. A maintainer reviews it.

  3. added
    needs-human
    and removed
    needs-triage
    on Oct 18, 2026
  4. removed
    needs-human
    on Oct 25, 2026
  5. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-24 rule: an issue stops for a person only for an intent or vision question, a security call, a host or attended run, or spend outside prepaid credit. The hold label came off and intake triage runs again now; it re-applies a hold, with a numbered question, when one of those applies.

    To hold this issue again, add needs-human (or status: needs-decision) and say why in a comment.

  6. added
    needs-triage
    needs-human
    and removed
    needs-triage
    on Oct 25, 2026
  7. melodic-automation-lanes commented on Oct 25, 2026

    @melodic-automation-lanes
    Contributor

    The triage verdict left this issue at status: needs-decision:

    • no Size: line
    • no Complexity: line
    • no Uncertainty: line
    • no Flags: line
    • the triage run escalated
    • held by needs-human
    • no lanes App verdict comment shows whether an earlier verdict was flagged
  8. added
    needs-owner-decision
    on Oct 25, 2026
  9. kyle-sexton commented on Oct 26, 2026

    @kyle-sexton
    MemberAuthor

    Builder: the Automation Lanes session builds this from the owner's machine. The fix edits .github/workflows, which the lanes App cannot push (patch-rules.json:3); that boundary stays. Its PR closes this issue. needs-human came off under the owner's 2026-10-26 rule (a person only for an intent or vision change, an implementation finding that alters intent or the primary design, or a HIGH/CRITICAL security issue); none applies. agent-ready stays off so the issue lane does not race the build.

  10. added
    status: confirmed
    and removed
    needs-owner-decision
    needs-human
    on Oct 26, 2026
  11. changed the title [-]fix(lanes): read-only cache and no id-token in jobs that run PR code[/-] [+]fix(lanes): read-only cache and no id-token in jobs that run PR code (hardening deferred)[/+] on Oct 31, 2026
  12. kyle-sexton commented on Oct 31, 2026

    @kyle-sexton
    MemberAuthor

    Closing as hardening deferred (§10). This issue sets cache-mode: read, drops id-token: write and moves token minting into a separate job in every lane job that runs PR code. It closes no open leak: its own body rates it low to medium and says it was deferred until the lanes run steadily. Under the standing direction, hardening issues wait until open issues and pull requests reach zero. Refile from this issue, with the body as the spec, when that point is reached.

  13. kyle-sexton commented on Oct 31, 2026

    @kyle-sexton
    MemberAuthor

    Closed as hardening deferred under standing direction §10; the comment above has the evidence. Trigger to refile: open issues = 0 and open PRs = 0.

  14. kyle-sexton commented on Oct 31, 2026

    @kyle-sexton
    MemberAuthor

    Reopening. Close audit at origin/main 28b1747: pr-review-hosted and pr-run-activity-read are fixed, but the resolve-issue and fix-docs model jobs still hold id-token write and no job sets a read-only cache. This sits on the token boundary, so the hardening-deferred close did not fit it. Needs a builder.

  15. added
    needs-triage
    on Oct 31, 2026
  16. changed the title [-]fix(lanes): read-only cache and no id-token in jobs that run PR code (hardening deferred)[/-] [+]fix(lanes): read-only cache and no id-token in jobs that run PR code[/+] on Oct 31, 2026
  17. added
    host-run
    on Nov 1, 2026
  18. kyle-sexton commented on Nov 1, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    The fix in the body stands: in every job that runs PR code, a read-only cache, no id-token: write, and App or OIDC tokens minted in a separate job. This is not own-actor hardening under §10: a job that runs PR code and holds id-token: write lets that code request an OIDC token for the lanes broker, and the body names outside text (the issue lane's web-access: domains: any) as the path to PR code, so it is a token-exposure path. At origin/main b9ae6bbaed, per the 2026-10-31 reopen comment, pr-review-hosted and pr-run-activity-read are fixed (.github/workflows/pr-run-activity-read.yml:408 "The only job in this file that may hold id-token: write"). .github/workflows/work-resolve-issue.yml still grants id-token: write at :263, :346, :414, :456, :484 and :849, and its only cache-mode: read is the pick-slot job at :162, which runs no PR code. .github/workflows/pr-refine.yml grants id-token: write to the fix-docs caller jobs at :170, :254, :319 and :358, and .github/workflows/pr-merge.yml at :835 and :2049; the build checks each against the jobs that run PR code. The checklist row C7 (.work/backlog-shaper-course-correction/interview-checklist.md:22, inherited, relayed 2026-10-18) reads "#8294/#8295 hardening deferred until lanes run steadily"; the 2026-10-31 reopen placed this on the token boundary. The fix edits workflow files, which the lanes App cannot push (.github/actions/resolve-config/patch-rules.json:75-76). Agents decided this on evidence under standing direction §1.

    Acceptance criteria:

    • Every job that runs PR code sets cache-mode: read.
    • No job that runs PR code holds id-token: write; App or OIDC tokens are minted in a separate job.
    • The lanes' existing workflow and script tests pass, and a lane run of the issue lane and of fix-docs completes after the change.

    Route: builder (Automation Lanes).

  19. kyle-sexton commented on Nov 1, 2026

    @kyle-sexton
    MemberAuthor

    Done. Closing on the cache half, with the owner's 2026-11-01 Q1 (a) decision applied to the body.

    • fix(lanes): give every job that runs PR code a read-only Actions cache #11824 (merged) sets cache-mode: read on the jobs that run PR code.
    • At origin/main, id-token: write remains only in jobs that run no PR code (pr-run-activity-read.yml broker-check, pr-merge.yml merge and enable-auto-merge), on callers' uses: of a lane runner (a cap on the callee, not a grant to PR code), and in pr-run-activity-write.yml's run job, the ADR 0058 residual the owner chose to keep (Q1 (a)). The read runner's head-code run job holds contents: read and pull-requests: read only, with cache-mode: read (pr-run-activity-read.yml:547-555).

    The body's Fix section now names that exception.

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

    host-runneeds-triagestatus: confirmed

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions