Skip to content

fix: authorize roll commands against electron/electron only#196

Merged
dsanders11 merged 2 commits into
mainfrom
claude/autopatch-scan-c14528b3-vuln-1895936-w8x2lh
Jun 25, 2026
Merged

fix: authorize roll commands against electron/electron only#196
dsanders11 merged 2 commits into
mainfrom
claude/autopatch-scan-c14528b3-vuln-1895936-w8x2lh

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Roller is installed on multiple repos, no need to get wires crossed

The /roll issue-comment handler authorized the commenter via
getCollaboratorPermissionLevel(context.repo({username})), where
context.repo() is derived from the repository the webhook comment was
posted in rather than electron/electron, the repository the privileged
roll actions actually modify. With an org-wide or multi-repo app
installation, a user with write/admin on any other installed repository
could post '/roll <branch>' on a PR titled 'chore: bump chromium ...'
and pass the authorization check, triggering handleChromiumCheck /
handleNodeCheck against electron/electron.

Bind the privilege check to the resource being acted upon:

- isAuthorizedUser now evaluates the commenter's permission against
  REPOS.electron explicitly instead of the webhook's source repo.
- The /roll command is only honored for comments originating from
  electron/electron.
- Apply the same origin guard to the pull_request.closed handler, which
  reached the identical privileged rolls from a merged 'chore: bump ...'
  PR in any other installed repository.

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

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.

I don't think the change in this file is required? This should be either kept as a generic isAuthorizedUser for the repo from context (generic and usable in other parts of the codebase) or renamed to isAuthorizedElectronRepoUser to make it clear it's not a generic function. I'm in favor of the former.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The point here is this is used as a "does the user have authority to do stuff on e/e" but the check runs in the context of the webhook which could be any repo roller is installed into (which is quite a few)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll rename this method for now (isAuthorizedElectronRepoUser is accurate)

Address review feedback from dsanders11: the authorization check is now
hardcoded to evaluate permissions against electron/electron, so the
generic name was misleading. Rename it to reflect that it specifically
authorizes users against the electron/electron repository.

No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LL7ZzLv5mo4Wqf3BiWk8HB
@dsanders11 dsanders11 merged commit 3fa5e1f into main Jun 25, 2026
5 checks passed
@dsanders11 dsanders11 deleted the claude/autopatch-scan-c14528b3-vuln-1895936-w8x2lh branch June 25, 2026 01:03
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