pwn request
A pull_request_target or similar privileged workflow that checks out and runs a pull request's code, handing an outsider the repository's secrets and write token.
It hands repository secrets and write access to anyone who can open a pull request.
In more detail
The checkout alone is harmless; the next step that builds, tests or installs from the checked-out tree runs the attacker's code. Build fork code on pull_request instead, where it gets no secrets and a read-only token.
Related terms
- pull_request_target — A pull request event that runs the base repository's workflow with its secrets and a write-capable token, even for pull requests from forks.
- script injection — An attack where untrusted text such as an issue title, pasted into a run script through an expression, ends the intended command and runs the attacker's own.
Taught in
- The Workflow That Ran On A Stranger's Pull Request — GitHub Actions (GH-200) Exam Prep
- Script Injection: When An Issue Title Becomes Code — GitHub Actions (GH-200) Exam Prep