One morning your CI for fork pull requests goes red, and you haven't touched a line. If your repository is public, the likely cause is that GitHub Actions now blocks pull_request_target by default. The rule took effect on Wednesday, December 2, 2026, and it directly affects teams running CI/CD on public repositories.
What GitHub changed
According to the GitHub Changelog, from December 2, 2026 workflows triggered by pull_request_target are blocked by default in affected public repositories, unless an Actions event policy explicitly allows them. The date was announced on November 2, with two test brownouts on November 9 and 16 so teams could find affected workflows.
Private and internal repositories are not affected. The change applies to public repositories on GitHub Free, Team and Enterprise Cloud, but not GitHub Enterprise Server.
Why pull_request_target is so risky
The pull_request event runs in the context of the fork: no access to secrets, and a read-only token. pull_request_target runs in the context of the base repository, so it can reach secrets and a token with write access.
That is the trap. If the workflow checks out and runs code from the fork (build, test, npm install), the pull request author is indirectly running their code with your privileges. Deployment keys, npm tokens or cloud credentials can leak in a single run.
The current climate makes this more pressing. The Hacker News (December 3, 2026) cited Aikido's report on a stolen-token campaign: 4,837 compromised accounts opened probe pull requests across 61,764 repositories, then added a new workflow, edited an existing one or inserted a postinstall hook in package.json to harvest Actions secrets and cloud credentials. Blocking a high-privilege trigger by default is a sensible layer against that pattern.
How to audit your repositories
First, find every workflow that uses the event. From the repository root:
grep -rn "pull_request_target" .github/workflows/For each file, answer three questions:
- Does the workflow check out the pull request's code (for example
ref: ${{ github.event.pull_request.head.sha }})? - Does any step after checkout execute code from that branch: install dependencies, build, test, run scripts?
- Does the job hold secrets or write permissions (
contents: write,packages: write...) it doesn't need?
If all three answers are yes, that is the classic dangerous pattern. Fix it before thinking about re-enabling it.
Next, open Policy insights for the repository or organization to see which runs were blocked. That is where GitHub lists the affected workflows.
Switching to pull_request with least privilege
Most workflows only need to test fork code and need no secrets. For those, switching to pull_request is enough:
name: ci
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm testThe permissions: contents: read block keeps the token read-only even if someone adds a new step later. Using npm ci instead of npm install installs exactly what the lockfile says and avoids pulling unreviewed versions.
If the workflow must write after a pull request is checked, such as adding a label or a comment, split it in two: the first workflow runs untrusted code with read-only access, and the second only processes the output it produced, without running fork code.
When you truly must keep pull_request_target
Some workflows genuinely need the event, for example auto-labelling by changed file paths without running the author's code. In that case create or update an event policy to allow it explicitly, scoped to specific workflow files rather than the whole repository. GitHub stresses allowing it only after confirming the workflow won't run untrusted pull request code with secrets or a privileged token.
A short checklist before turning it back on:
- No checkout of the pull request
headcombined with any execution step. - No titles, branch names or PR descriptions interpolated into shell commands without going through environment variables.
- Explicit, minimal
permissions. - Secrets only in the job that really needs them.
What about private repositories
Private repositories aren't blocked yet, but that doesn't make them safe. A compromised collaborator account or a poisoned branch can still push malicious code into your pipeline. Auditing pull_request_target, tightening permissions and rotating secrets stored in workflows should be done across all repositories. Our earlier posts on the PolinRider malware hidden in GitHub repos and on hijacked GitHub accounts (both in Vietnamese) describe how attackers get in through accounts.
If your team lacks time for a full pipeline review, start with the grep above on your busiest public repository, note which workflows need changes, and work through them in priority order. For examples of the software we build, see our projects page.
Sources
- GitHub Changelog, "pull_request_target blocked by default December 2" (Nov 2, 2026): https://github.blog/changelog/2026-11-02-pull_request_target-blocked-by-default-december-2/
- GitHub Changelog, "pull_request_target enforcement begins December 2" (Dec 2, 2026): https://blog.github.com/changelog/2026-12-02-github-actions-will-block-pull-request-target-by-default-in-affected-public-repo/
- The Hacker News, "8 Malicious PyPI Packages Use Python Dependencies as Keys to Unlock Hidden Malware" (Dec 3, 2026): https://thehackernews.com/2026/12/8-malicious-pypi-packages-use-python.html






