GitHub Actions starts blocking pull_request_target workflows by default in public repositories
In brief
GitHub Actions began blocking pull_request_target workflows by default in affected public repositories on Dec. 2.
1 min read
Translated from the Korean original. Read the original in Korean
Why it matters
- A default path that let unverified code from forks reach the base repository's secrets is now closed, reducing the risk that build pipelines in public repositories are hijacked.
- Maintainers of public repositories that rely on this event will see their workflows stop unless they create an allow policy themselves.
Key details
Workflows triggered by pull_request_target run in the context of the base repository and can access that repository's secrets. Running untrusted code from a fork in this context could expose secrets or compromise the build pipeline. GitHub blocks these workflows unless an applicable GitHub Actions event policy explicitly allows them. Event policies already in place continue to apply.
Context
GitHub first announced the change on Nov. 2 and has now issued a reminder. The effective date has not changed. The change applies to affected public repositories on GitHub Free, Team and Enterprise Cloud. Private and internal repositories are not affected.
Outlook
GitHub advised maintainers of workflows that respond to pull requests from forks to check blocked runs in Policy insights. Where possible, they should switch to a safer event such as pull_request, and if pull_request_target is essential, they should create or modify an event policy to allow it explicitly. The allowance can be narrowed to specific workflow files. GitHub said maintainers should allow it only after confirming that the workflow does not run untrusted pull request code while secrets or privileged tokens are present.