pull_request_target: when it is safe, and GitHub's block since December 2
pull_request_target runs a workflow from your default branch with the base repository's secrets and a read/write token, even for a fork's pull request. It stays safe until the workflow runs the fork's code, a "pwn request". Since December 2, 2026, GitHub blocks it by default in public repositories unless an Actions event policy allows it.
What is the difference between pull_request and pull_request_target?
The difference between pull_request and pull_request_target is whose code runs and with what trust. Both fire on the same pull request activity; GitHub's docs, read December 1, 2026, set them apart like this:
| pull_ | pull_ | |
|---|---|---|
| Workflow file comes from | The pull request's merge commit | The default branch (since December 8, 2025, whatever the base branch) |
| GITHUB_TOKEN from a fork | Read only | Read/write |
| Secrets from a fork | Withheld | Repository and organization secrets |
| A checkout without a ref gets | The pull request's merge commit | The default branch, so no fork code runs |
GitHub's advice: if a workflow doesn't need extra secret access, use pull_request.
What is a pwn request?
A pwn request is a pull_request_target workflow (or any other privileged one) that checks out a fork's code and then runs it, so an attacker's Makefile or test script executes with your secrets. GitHub calls it "the root cause of multiple supply-chain compromises" and gives this insecure example:
# INSECURE. Provided as an example only.
on:
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Test
run: make test
The checkout alone runs nothing; make test runs the fork's Makefile. GitHub lists three common shapes:
- Checking out the pull request's head or merge commit, then building, testing or running it.
- Setting
repository:to the fork to pull its branch directly. - Fetching the code another way (
git fetch,gh pr checkout, or an artifact from the fork's run) and running it.
The same mistake works in issue_comment and workflow_run workflows that fetch and run fork code.
What changed for pull_request_target on December 2, 2026?
Since December 2, 2026, GitHub blocks pull_request_target by default in public repositories unless an Actions event policy allows it. A workflow that the event would start is blocked instead of run. GitHub's changelog on the day, "pull_request_target enforcement begins December 2", repeated that "the enforcement date hasn't changed" and pointed maintainers to Policy insights. GitHub had first set the date for November 2, 2026, and tested the block in two brownouts, on November 9 and 16 from 16:00 to 18:00 UTC.
- It applies to public repositories on GitHub Free, Team and Enterprise Cloud; not to private or internal repositories, and not to GitHub Enterprise Server.
- In the brownouts, blocked runs failed with an error annotation and did not execute. Policy insights, under Settings, Actions, show which runs a policy blocks.
- An event policy the repository already had is not replaced: that policy still decides.
- To keep a workflow that needs the event, open Settings, Actions, Policies and create an event policy whose Restrict events protection allows
pull_request_target, targeted at that workflow file.
The policy comes from workflow execution protections, generally available since September 17, 2026, which also set who may trigger a workflow and which events may start it.
The block reaches many popular projects. On December 2, 2026, 41 of the 100 most-starred GitHub repositories with workflows had at least one pull_request_target workflow, 108 files in all, in a scan of their workflow files. A file can't show whether a repository has since added an event policy that allows it.
What does actions/checkout refuse in pull_request_target?
actions/checkout refuses to fetch a fork's pull request code in pull_request_target and workflow_run workflows, from version 7 (June 18, 2026) and, since July 20, 2026, in every supported major version but v1. It fails when the pull request comes from a fork and the step points at the fork's repository, at refs/pull/N/head or refs/pull/N/merge, or at the fork's head or merge SHA.
- Workflows on a floating tag such as
actions/checkout@v4got the change automatically; ones pinned to a SHA or exact version need an upgrade. - It doesn't cover
git fetch,gh pr checkout, downloaded artifacts or other repositories. - Opting out takes
allow-unsafe-pr-checkout: true, named to stand out in review; use it only when the checked-out code never runs.
When do you still need pull_request_target, and how do you keep it safe?
You still need pull_request_target for automation that responds to fork pull requests with write access, such as labeling and triage, or for checks that need a private registry. GitHub's hardening steps for it (zizmor's dangerous-triggers audit finds every such workflow, and the CI/CD security tools list the rest):
- Give the token the least it needs with
permissions:, and only the secrets that job uses (see GitHub Actions permissions). - Never build, test or run checked-out fork code in the same job.
- Expect the cache to be read-only: these runs can restore the default branch's entries but not save new ones.
- Run it on isolated, ephemeral machines; a self-hosted runner must be cut off from internal resources and not reused between runs.
- Treat titles, branch names and other pull request text as untrusted input in
run:steps.
How was this page checked?
Every rule and date here was read on December 1, 2026 from GitHub's pull_request_target and workflow syntax docs and four GitHub changelog posts; the enforcement rule, the policy settings and GitHub's December 2 changelog were read on December 2, 2026, as was zizmor's audit list. The workflow example is GitHub's own, marked insecure; no workflow was run for this page. Errors: support@winding.ai.
- GitHub Changelog, December 2, 2026: pull_request_target enforcement begins December 2 (read December 2, 2026)
- zizmor audits: dangerous-triggers, dangerous-checkout (read December 2, 2026)
- GitHub Docs: Securely using pull_request_target (read December 2, 2026)
- GitHub Changelog, November 2, 2026: pull_request_target blocked by default December 2 (read December 2, 2026)
- GitHub Docs: Governing execution of GitHub Actions workflows (read December 2, 2026)
- GitHub Changelog, September 17, 2026: workflow execution protections generally available (read December 1, 2026)
- GitHub Changelog, June 18, 2026: safer pull_request_target defaults for actions/checkout (read December 1, 2026)
- GitHub Changelog, November 7, 2025: pull_request_target and environment branch protection changes (read December 1, 2026)
- GitHub Docs: Workflow syntax (permissions) (read December 1, 2026)
- GitHub Docs: Secure use reference (read December 1, 2026)