A pipeline runs whatever the triggering commit says, with the pipeline's secrets and permissions. A fork pull request that reaches a privileged workflow, or a branch name pasted into a run step, is code execution inside your build.
- Run unreviewed code on isolated runners with no secrets and no access to sensitive environments.
- Avoid running privileged pipelines for fork contributions, or require a maintainer's approval before they run.
- Protect every branch that can trigger a sensitive pipeline, and review CI configuration changes before they run.
- Give each pipeline only the credentials it needs, with the minimum privileges.
Guides on this site
Keep untrusted CI work outside the release boundary
Review workflow authority, persistent state and artifact handoffs before contributor-controlled code reaches privileged jobs.
Harden GitHub Actions against workflow and supply-chain attacks
Close the paths that give untrusted pull-request code secrets or a write token: pass context through env, keep pull_request_target away from fork code, pin actions to commit SHAs, scope GITHUB_TOKEN and OIDC, and treat artifacts as data.
Protect the path from pull request to release
Separate untrusted contribution checks from privileged release work and verify the identity of the artifact that is actually deployed.
Case study: the tj-actions/changed-files compromise (CVE-2025-30066)
In March 2025 an attacker moved the version tags of a popular GitHub Action, and of a reviewdog action before it, to code that printed CI secrets into build logs. This case study traces the token chain back to one pull_request_target workflow, sizes the exposure, and shows how it was caught and which controls held.
Practice
- Actions injection lab: Flag GitHub Actions expression injection · Browser lab
- Build and verify a signed software release · Local project
- Repair a security pipeline for GitHub Actions and GitLab CI · Local project
References
List data from the publisher. A guide is listed as the main subject when the weakness or risk is what the guide is about, and as covering it when a dedicated section or worked example addresses it.