pull_request_target is a GitHub Actions trigger that runs a workflow in the context of the base repository, not the fork or branch that opened the pull request. Because it can use the repository’s normal permissions, it may also access secrets, write tokens, and other privileged CI resources if the workflow is configured that way.
This matters because it crosses a trust boundary. A workflow that reacts to untrusted pull requests can become dangerous if it checks out attacker-controlled code or passes unreviewed data into shell commands while holding secrets. In real attacks, adversaries try to make the privileged job execute their code, leak tokens, or modify build outputs. Defenders use pull_request_target carefully: keep privileged steps minimal, never run untrusted code in the secret-bearing job, pin actions, and separate validation from deployment.


