Skip to content

Investigate security implications of pull_request_target with unrestricted fork admission #72666

Done

Description

@pelikhan

Summary

Investigate whether allowing on.pull_request_target.forks: ["*"] with a warning provides an adequate security boundary for privileged agentic workflows, or whether stronger enforcement is needed.

Follow-up to #72579, currently open. At commit 166d553d0bd0a11f29b925b9c9f3f5458c395126, the proposed behavior is:

  • Omitted forks and explicit forks: [] admit same-repository PRs only.
  • Exact owner/repo and trusted owner/* patterns admit matching forks in addition to same-repository PRs.
  • Explicit "*", including in a supported list, admits all forks. Strict mode emits a warning recommending narrower admission rather than rejecting compilation.
  • Actor authorization and checkout restrictions remain independently enforced. acknowledge-risk does not suppress the wildcard warning or bypass those restrictions.

This is a threat-model and policy investigation, not a report of a confirmed exploitable vulnerability. Relative to the current main baseline, the PR adds target fork filtering and a restrictive default; relative to its earlier bounded-only revision, permitting a wildcard replaces an enforcement boundary with a warning.

Security questions

A trusted event actor does not imply trusted PR content. For example, an authorized maintainer could label an outsider's PR and trigger an agent that consumes attacker-controlled text or diffs. checkout: false prevents automatic checkout but does not prevent the agent from reading that content. pull_request_target runs in the base-repository context; actual exposure depends on configured token permissions, available credentials/secrets, tools, network policy, and safe outputs.

Investigate:

  • Which target event types allow a trusted actor to activate work on an untrusted fork PR, and how actor authorization differs from PR-author or head-repository trust.
  • Prompt-injection paths through PR bodies, comments, diffs, changed files, links, or artifacts, and whether these can induce credential disclosure, unauthorized mutations, or execution of untrusted code.
  • Whether checkout restrictions remain effective throughout agent execution, including agent-initiated downloads, shell commands, and manual git operations—not just compiler-managed checkout steps.
  • Whether wildcard admission should remain warning-only in strict mode, require a distinct explicit dangerous capability, or be rejected. Assess compatibility and migration implications without presupposing the outcome.
  • Whether bounded owner/repository patterns materially reduce each attack path, and their limitations; neither should be described as making PR content inherently trustworthy.
  • Whether diagnostics clearly explain the residual risk and remain visible when acknowledge-risk is set or checkout is disabled.

Expected outcome

  1. Document a concrete threat model and the distinction between event-actor authorization, fork admission, content trust, and granted capabilities.
  2. Exercise representative adversarial scenarios in controlled fixtures and identify which existing controls prevent each scenario and which risks remain. Do not execute privileged live workflows without separate authorization.
  3. Recommend and justify the strict-mode policy for unrestricted admission, including compatibility/migration guidance if behavior should change.
  4. Add focused regression coverage and documentation for any resulting changes, preserving actor authorization and checkout safeguards.

References

Activity

  1. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    Assigned to @pelikhan: recent merged work on the compiler and security-related changes matches this issue's compiler/security labels.

    Generated by 🔧 Daily Assign Issue To User · copilot · auto · ~14 AIC · ⌖ ~1 AIC · ⊞ 7.7K · ◷

  2. pelikhan commented on Nov 4, 2026

    @pelikhan
    CollaboratorAuthor

    @copilot update compiler to dissallow forks * in strict mode, still warning in non strict mode.
    Error can be disabled by setting features.dangerously-allow-pull-request-target-forks-all

  3. assigned and unassigned on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compilerenhancementsecurity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions