GitHub blocks pull_request_target in public repos from December 2

From December 2, 2026, GitHub Actions blocks pull_request_target by default in public repos unless an event policy allows it. A two-hour brownout runs on November 16.

Published 6 min read#Supply chain security#Developer tools

If you have a public repository on GitHub with a workflow that runs on pull_request_target, such as a workflow that adds labels to pull requests from forks, that workflow is going to stop. In two minutes you can find out whether your repository is affected, and then choose: keep the block, move to pull_request, or allow the event for one workflow file only.

What changes in GitHub Actions, and when?

From December 2, 2026, GitHub Actions will block pull_request_target events by default in all public repositories, unless an Actions event policy explicitly allows them.

GitHub said so in its announcement of the block on November 2, the same day that had first been set for enforcement before it moved. For now, the default policy runs in evaluate mode: workflows run with warnings, and you can see which runs it would block.

Before the permanent block there is a brownout, when GitHub enforces the block for two hours: November 16, 2026, from 16:00 to 18:00 UTC.

During those two hours, any pull_request_target run in an affected public repository becomes a failed run with an error annotation, and the workflow does not run. After that window, the policy goes back to evaluate mode.

The change covers public repositories on GitHub Free, GitHub Team, and GitHub Enterprise Cloud. Private and internal repositories are not affected, and the change does not apply to GitHub Enterprise Server.

Why is GitHub blocking pull_request_target?

The pull_request_target event runs the workflow in the context of the base repository with access to its secrets, so if the workflow runs code from a fork, that code can steal the secrets or compromise your pipeline.

The difference shows when you compare it with pull_request. According to GitHub's docs on using pull_request_target securely, the pull_request event runs the workflow file from the pull request's merge commit, which for a fork is code from the fork's author, so GitHub gives it a read-only GITHUB_TOKEN and withholds other secrets. pull_request_target takes the workflow file from your repository's default branch instead, and gives it the base repository's GITHUB_TOKEN and access to repository and organization secrets.

That setup is safe as long as no code from the fork runs. The risk starts when the workflow author checks out the pull request's code and runs it, as in this example from the docs, which is marked "INSECURE":

# 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 step alone runs nothing. What completes the flaw is make test, because it runs a Makefile from the pull request. An attacker only needs to open a pull request from a fork and put commands in the Makefile, a build script, a configuration file, or a dependency, and those commands run with your repository's secrets and token. This pattern is called a "pwn request", and the docs say it has been the root cause of multiple supply-chain compromises.

How do you know if your repository is affected?

Search for pull_request_target in your .github/workflows files, then open the Policy insights page in the repository settings, which shows the runs that would be blocked.

  1. From the root of your repository, run:

    grep -rn "pull_request_target" .github/workflows/

    If nothing comes back, this change does not touch that repository.

  2. Open Settings in the repository, and in the left sidebar under Actions, click Policies. The Policy insights page sits right under it and lists the runs that were blocked or would have been blocked, according to GitHub's docs on controlling workflow execution.

  3. If your repositories belong to an organization, both pages are in the organization settings too.

Do you need pull_request_target at all?

You need pull_request_target only if the workflow needs secrets or a write-scoped token on pull requests from forks. Otherwise pull_request is enough, and GitHub's docs say to use it.

According to the same docs, the event is useful for automation that responds to pull requests from forks: labeling, triage, and posting authenticated status checks. Before you keep it, the docs ask two questions:

  1. Can you use pull_request instead? It triggers on the same events as pull_request_target, and it runs safely on pull requests from forks. A more complex workflow can be split: one part handles the pull request code with no secrets, and another part holds the secrets and never touches the pull request code.

  2. Is the checked-out code ever executed? Execution is not limited to your own steps: npm install and npm run build, plus the configuration files and dependencies the code brings with it, can all run the attacker's code. If you need pull_request_target, the checked-out code must only be read as data and never run.

How do you keep pull_request_target for one workflow?

Create an event policy in the repository settings that allows pull_request_target, and scope it to the workflow file that needs it (workflow file targeting), as GitHub's announcement recommends.

  1. Open Settings in the repository, and under Actions in the left sidebar, click Policies.

  2. Create a new policy, and give it a name and an enforcement status.

  3. For the target, pick the workflow file that needs the event, not the whole repository.

  4. Under Restrict events, allow pull_request_target.

The docs describe these protections as an allowlist that controls which events are permitted to run the workflows you target. So if the same file also runs on push or workflow_dispatch, keep those on the list too. In an organization, the owner can create policies at the organization level, and policies layer on top of each other like rulesets.

The same Policies page also has the Require lockfile protection, which blocks any targeted workflow that isn't onboarded to the repository's lockfile. The protection and the command that writes the file are covered in locking GitHub Actions with an actions.lock file.

If you keep it, how do you lower the risk?

Don't check out the pull request's code and run it in a workflow that holds secrets, and keep GITHUB_TOKEN permissions and secrets to exactly what the workflow needs.

The same GitHub docs add:

  • Give GITHUB_TOKEN the least privileges it needs, and use only the repository and organization secrets the workflow needs.

  • Workflows triggered by pull_request_target have read-only access to the default branch's cache, to reduce the risk of cache poisoning. Don't reopen writes with cache-mode; if you need to fill the cache, do it from a workflow that runs on push.

  • If you use self-hosted runners, keep them restricted from your internal resources, and don't reuse them from one run to the next.

  • Enable CodeQL for your workflows: other flaws such as command injection can sit in a workflow that runs with these privileges, and CodeQL catches the common ones.

  • The allow-unsafe-pr-checkout: true input in actions/checkout allows checking out a pull request head from a fork. The docs say to use it only after you confirm the checked-out code never runs, and its name is chosen on purpose to be easy to spot in code review and static analysis.

If you find a workflow that was checking out and running pull request code while it held secrets, treat those secrets as exposed and replace all of them. The secret rotation order from the Railway breach article works here too.

Where do you start now?

Run the grep command on every public repository you own. If pull_request_target shows up, open Policy insights and decide for each workflow: move it to pull_request, let it be blocked, or allow it with a policy scoped to its file.

If you want someone to test your project and look for exposed secrets before you open it to outside contributors, that is what Muhassan does. There are also more articles on supply chain security.

Does your workflow need secrets on pull requests from forks, or would pull_request do?

FAQ

Will private repositories be affected?

No. Private and internal repositories are not affected. The change covers public repositories on GitHub Free, GitHub Team, and GitHub Enterprise Cloud, and not GitHub Enterprise Server.

What happens to my workflow during a brownout?

You get a failed run with an error annotation, and the workflow does not run. After the two hours, the default policy goes back to evaluate mode, and workflows run with warnings.

If I already have an event policy, does the default policy replace it?

No. According to GitHub's docs, the default policy does not replace an applicable event policy you have already set up, and it is only added to public repositories that have none.

Does blocking pull_request_target close every pwn request risk?

No. GitHub's docs say any event that runs with secrets can have the same flaw, such as issue_comment or workflow_run, if it fetches a fork's pull request code and runs it.

Share

More articles