fix: derive roll write target from trusted state, not untrusted PRs#198
Merged
dsanders11 merged 2 commits intoJun 25, 2026
Merged
Conversation
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
dsanders11
reviewed
Jun 25, 2026
dsanders11
left a comment
Member
There was a problem hiding this comment.
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
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.