GitHub Actions Enhances Security by Default Blocking Risky `pull_request_target` Workflows
As of December 2, 2026, GitHub Actions has implemented a significant security enhancement by defaulting to block `pull_request_target` workflows in public repositories. This change aims to close a critical security vulnerability where workflows triggered by `pull_request_target` could execute untrusted code from external forks with elevated permissions and access to sensitive repository secrets.
This update is crucial for any organization maintaining public repositories and utilizing GitHub Actions for their CI/CD pipelines. The `pull_request_target` event, while useful for certain metadata operations, inherently runs in the context of the base repository, granting it access to tokens and secrets that could be exploited if malicious code from a pull request were to be executed. By making this a default block, GitHub is proactively hardening the software supply chain against potential attacks that leverage compromised CI/CD pipelines.
This move aligns with a broader industry trend towards shifting security left and implementing secure-by-default configurations in CI/CD platforms. The increasing sophistication of supply chain attacks has forced platform providers to take more aggressive stances on security. GitHub's 2026 roadmap, announced earlier, emphasized securing GitHub Actions across ecosystem, attack surface, and infrastructure layers, with a focus on making secure behavior the default. This particular enforcement is a direct outcome of that strategic direction, addressing a well-known vector for privilege escalation and secret exfiltration.
In practice, developers and DevOps teams must immediately audit their public repository workflows. Any workflow using `on: pull_request_target` needs to be identified. For most standard pull request testing scenarios, migrating to the `pull_request` event is the recommended and safer alternative, as it runs in a more isolated context with limited permissions. If `pull_request_target` is absolutely necessary for specific, privileged metadata tasks, teams must create or update GitHub Actions event policies to explicitly allow it, ensuring that such workflows are meticulously reviewed to prevent the execution of untrusted code with elevated privileges or access to secrets. Failure to adapt will result in blocked workflow runs, disrupting CI/CD processes.
Read original source