Repository navigation
Description
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
forksand explicitforks: []admit same-repository PRs only. - Exact
owner/repoand trustedowner/*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-riskdoes 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-riskis set or checkout is disabled.
Expected outcome
- Document a concrete threat model and the distinction between event-actor authorization, fork admission, content trust, and granted capabilities.
- 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.
- Recommend and justify the strict-mode policy for unrestricted admission, including compatibility/migration guidance if behavior should change.
- Add focused regression coverage and documentation for any resulting changes, preserving actor authorization and checkout safeguards.
References
- Related PR: fix(workflow): prevent compiler-only PR trigger filters from leaking #72579
- Relevant implementation:
pkg/workflow/pull_request_target_validation.go,pkg/workflow/filters.go - Relevant tests:
pkg/workflow/pull_request_target_forks_test.go,pkg/workflow/filters_forks_test.go - Decision record:
docs/adr/72579-apply-fork-filters-to-pull-request-target.md
Activity
github-actions commentedon Nov 4, 2026
Assigned to @pelikhan: recent merged work on the compiler and security-related changes matches this issue's
compiler/securitylabels.pelikhan commentedon Nov 4, 2026
@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