GitHub to Block 'pull_request_target' by Default, Enhancing Supply Chain Security
GitHub is set to implement a critical security change on December 2, 2026, by blocking the `pull_request_target` trigger by default in public repositories. This move aims to mitigate a significant vector for software supply chain attacks, where malicious actors could exploit this trigger to gain access to repository secrets and compromise projects.
This change is paramount for any organization utilizing GitHub Actions, particularly those with public repositories. The `pull_request_target` trigger, while seemingly similar to the safer `pull_request` trigger, operates with elevated permissions, allowing workflows to access secrets from the base repository even when triggered by a pull request from a fork. This has been a known vulnerability, exploited in past incidents to exfiltrate credentials and inject malicious code.
The broader trend in cloud and DevOps security emphasizes a shift towards secure-by-default configurations and least-privilege access. This GitHub initiative aligns perfectly with this trend, following a series of supply chain attacks that have highlighted the need for more stringent controls over CI/CD pipelines. The Python Software Foundation, for instance, has already proactively removed dangerous GitHub Actions triggers across its organizations in anticipation of this change, demonstrating the industry's move towards hardening build processes.
In practice, developers and DevOps engineers must immediately audit their GitHub Actions workflows, specifically looking for `on: pull_request_target` in their YAML files. For public repositories, any workflow using this trigger will cease to function as expected after December 2nd unless an explicit organizational policy permits it. Teams on GitHub Free plans will need to make these changes repository by repository, while GitHub Team and Enterprise users can apply organization-wide policies. Projects that legitimately use `pull_request_target` for tasks like labeling pull requests from forks or running on-demand CI will need to refactor these workflows. Alternatives like using the `pull_request` trigger with carefully scoped permissions, or leveraging GitHub's Trusted Publishers for secure publishing to package registries, should be explored. Failure to adapt will result in broken CI/CD pipelines and potential disruptions to development and deployment processes.
Read original source