Skip to content

fix: enforce allowed_bots check for all bot actors#1400

Open
anishesg wants to merge 1 commit into
anthropics:mainfrom
proudhare:fix/ph-issue-591
Open

fix: enforce allowed_bots check for all bot actors#1400
anishesg wants to merge 1 commit into
anthropics:mainfrom
proudhare:fix/ph-issue-591

Conversation

@anishesg

Copy link
Copy Markdown

The permissions check in src/github/validation/permissions.ts had a security bypass where actors ending with [bot] were automatically granted access without checking the allowed_bots input. This meant that github-actions[bot] and other accounts could trigger the action even when allowed_bots was empty or didn't include them.

The issue manifested when GitHub Actions comments were marked with a reaction but didn't trigger the workflow. This was because the actor passed the permissions check but was then silently rejected elsewhere in the execution flow.

The fix moves the isAllowedBot check to apply to all actors with the [bot] suffix, not just those that fail the collaborator API lookup. Now actors must be explicitly listed in allowed_bots (or use allowed_bots: '*' to allow all) before they can trigger the action.

Updated test cases to verify that actors are properly validated against the allowed_bots list and will be rejected when not included.

Fixes #591

The permissions check in `src/github/validation/permissions.ts` had a security bypass where actors ending with `[bot]` were automatically granted access without checking the `allowed_bots` input. This meant that `github-actions` and other accounts could trigger the action even when `allowed_bots` was empty or didn't include them.

Signed-off-by: anish <anishesg@users.noreply.github.com>
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.

Github Bot PR comment doesn't trigger Claude even though invoked

1 participant