Skip to content

fix: derive roll write target from trusted state, not untrusted PRs#198

Merged
dsanders11 merged 2 commits into
mainfrom
claude/autopatch-scan-1f76d7a8-vuln-1895948-j8g5tg
Jun 25, 2026
Merged

fix: derive roll write target from trusted state, not untrusted PRs#198
dsanders11 merged 2 commits into
mainfrom
claude/autopatch-scan-1f76d7a8-vuln-1895948-j8g5tg

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

During a roll, the bot listed all open PRs whose base is the branch being rolled and whose title starts with "chore: bump node"/"chore: bump chromium", then called updateDepsFile with branch = pr.head.ref. Any GitHub user can open such a PR from a fork, where head.ref is just the fork's branch name. By naming a fork branch after one of the bot's own roll branches (e.g. roller/chromium/35-x-y), an attacker could steer the privileged GitHub App into reading from and committing a DEPS change onto that branch, and have their PR's title/body/labels rewritten by the bot.

The branch the bot reads from and commits to is now derived solely from trusted state it created itself (roller//). Each candidate PR must originate from a branch in the electron/electron repo (not a fork) and be named exactly as the bot names its roll branches before any privileged write, pulls.update, or updateLabels call runs. Attacker-controlled fields (head ref, title, body) can no longer select the write target or receive bot mutations.

During a roll, the bot listed all open PRs whose base is the branch being
rolled and whose title starts with "chore: bump node"/"chore: bump chromium",
then called updateDepsFile with branch = pr.head.ref. Any GitHub user can open
such a PR from a fork, where head.ref is just the fork's branch name. By naming
a fork branch after one of the bot's own roll branches (e.g.
roller/chromium/35-x-y), an attacker could steer the privileged GitHub App into
reading from and committing a DEPS change onto that branch, and have their PR's
title/body/labels rewritten by the bot.

The branch the bot reads from and commits to is now derived solely from trusted
state it created itself (roller/<target>/<electron branch>). Each candidate PR
must originate from a branch in the electron/electron repo (not a fork) and be
named exactly as the bot names its roll branches before any privileged write,
pulls.update, or updateLabels call runs. Attacker-controlled fields (head ref,
title, body) can no longer select the write target or receive bot mutations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLpSSfaSgt232HGpNNQ6iZ
@MarshallOfSound MarshallOfSound requested review from a team as code owners June 25, 2026 00:54

@dsanders11 dsanders11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also check the author of the PR is electron-roller[bot]?

Addresses review feedback: in addition to verifying that the PR head lives in
the electron/electron repo and is named exactly as the bot names its roll
branches, require the PR author to be the roller bot itself before performing
any privileged DEPS write or applying title/label updates. This subsumes the
previous trop-login prefix check and adds defense in depth so that none of a
PR's attacker-controllable fields (author, head ref, title, body) can select
the target of a privileged commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QLpSSfaSgt232HGpNNQ6iZ
@dsanders11 dsanders11 merged commit a703e4d into main Jun 25, 2026
5 checks passed
@dsanders11 dsanders11 deleted the claude/autopatch-scan-1f76d7a8-vuln-1895948-j8g5tg branch June 25, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants