Skip to content

GitHub ACL: same-repo shortcut can trust untrusted issue comment sender #2664

@chmouel

Description

@chmouel

Summary

The GitHub ACL path in pkg/provider/github/acl.go allows any PR event with HeadURL == BaseURL and different branches.

For issue_comment events, Sender is the comment author, not the PR author. This can allow an untrusted commenter to pass ACL checks on same-repo PRs and trigger GitOps commands (/test, /retest, etc.) without collaborator/org/OWNERS checks.

Impact

  • Unauthorized CI trigger on same-repo PR comment flows
  • Resource abuse / control-plane abuse risk on public repositories

Current behavior

aclCheckAll() early-returns allow for same-repo PR topology before validating sender trust.

Expected behavior

Only allow this shortcut when sender identity is the PR submitter context (e.g. PR event), or otherwise require explicit sender trust (collaborator/org/OWNERS).

Proposed fix

  • Restrict same-repo shortcut to pull_request event flows (not issue_comment replay/command flows), OR
  • Validate sender collaborator membership before applying same-repo shortcut.

Test plan

  • Add regression test: non-collaborator issue_comment on same-repo PR should be denied.
  • Ensure same-repo pull_request event behavior remains allowed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions