Skip to content

RHOAIENG-51481: switch pull_request_target to pull_request#763

Merged
Gkrumbach07 merged 1 commit intomainfrom
kdreyer/disable-pull-request-target
Mar 2, 2026
Merged

RHOAIENG-51481: switch pull_request_target to pull_request#763
Gkrumbach07 merged 1 commit intomainfrom
kdreyer/disable-pull-request-target

Conversation

@ktdreyer
Copy link
Contributor

@ktdreyer ktdreyer commented Mar 2, 2026

External contributors disclosed vulnerabilities in our pull_request_target workflows. Switching to pull_request prevents untrusted fork code from running with access to repository secrets.

Leave the dependabot-auto-merge workflow unchanged, because it checks github.actor as a guard and never checks out code.

Once we merge this, these workflows will no longer act on forks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Fixes: #749

https://issues.redhat.com/browse/RHOAIENG-51481

@ktdreyer
Copy link
Contributor Author

ktdreyer commented Mar 2, 2026

Long-term, we want a "safe-to-test" label that operates on the exact sha that is safe to test, rather than blindly trust-on-first-use

@ktdreyer ktdreyer changed the title switch pull_request_target to pull_request RHOAIENG-51481: switch pull_request_target to pull_request Mar 2, 2026
Copy link
Contributor Author

@ktdreyer ktdreyer left a comment

Choose a reason for hiding this comment

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

Reviewed this 1:1 with Gage and he pointed out that we need a change, which I've implemented here (see resolved conversation).

@ktdreyer
Copy link
Contributor Author

ktdreyer commented Mar 2, 2026

Upon reflection, these workflows will likely run-and-fail now, because we're not adding guards "don't run these PRs from forks at all". I will add conditionals so we only execute these pull_requests if the author is a member of the org (in other words: they have permission to push here).

EDIT: I've done this now.

External contributors disclosed vulnerabilities in our
pull_request_target workflows. Switching to pull_request prevents
untrusted fork code from running with access to repository secrets.

Leave the dependabot-auto-merge workflow unchanged, because it checks
github.actor as a guard and never checks out code.

Now that we are running these workflows on pull_request triggers, forks
will not have access to the GHA secrets. Skip running these workflows
altogether on PRs that originate from forks, rather than failing when
GHA cannot find the secrets any more.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ktdreyer ktdreyer force-pushed the kdreyer/disable-pull-request-target branch from 7b32be4 to ca12dcc Compare March 2, 2026 16:40
@Gkrumbach07 Gkrumbach07 merged commit f3d6cc6 into main Mar 2, 2026
15 of 25 checks passed
@Gkrumbach07 Gkrumbach07 deleted the kdreyer/disable-pull-request-target branch March 2, 2026 17: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.

Security: amber-auto-review.yml workflow is vulnerable to prompt injection from fork PRs

2 participants