← OWASP Top 10 CI/CD Security Risks
CICD-SEC-5
Insufficient PBAC (Pipeline-Based Access Controls)
Pipelines and the jobs inside them get more access than they need: write tokens, every secret, shared runners. Once one step is compromised, the rest of the pipeline's access comes with it.
Summary in ghtier's words. Read OWASP CI/CD's own text
Incidents (6)
Last 12 months (2): prt-scan: automated pull_request_target attacks, hackerbot-claw autonomous agent RCE
2026
- prt-scan: automated pull_request_target attacks March 2026
- hackerbot-claw autonomous agent RCE February 2026
2025
- GitHub MCP / agentic token breadth May 2025
2023
- Self-hosted runner takeovers (PyTorch and others) January 2023
2022
- GitHub App installation token abuse January 2022
2021
Attack path techniques used
- Add a workflow that dumps secrets (Steal CI secrets and tokens)
- Run PR code in a privileged workflow (Steal CI secrets and tokens)
- Read secrets from the runner (Steal CI secrets and tokens)
- Prompt an AI step in a workflow (Steal CI secrets and tokens)
- Backdoor a persistent self-hosted runner (Poison the build or published package)
- Publish a malicious version with a stolen token (Poison the build or published package)
- Get an agent to copy private code into public (Read or expose private code)
Checklist items
The fixes for those techniques, plus the items ghtier tags with this risk.
- CODEOWNERS in place, required on sensitive paths
- Rulesets applied: push restriction, tag protection, sensitive file-path protection
- Inventory every Actions secret and its visibility/scope; the results are usually surprising
- Cloud credentials migrated from static keys to OIDC federation, scoped to repo + branch
- Put production secrets in environments with required reviewers
- Audit every use of pull_request_target and remove or restructure risky ones
- Set the default GITHUB_TOKEN permission to read-only at the org level
- Require approval for first-time/external contributor workflow runs on forks
- Limit who and what can trigger workflows with workflow execution protections
- Third-party Actions pinned to a full commit SHA instead of a mutable tag or branch
- Restrict which Actions can run to GitHub-verified creators or an internal allow-list
- Limit where workflow jobs can connect to, starting with release and deploy jobs
- Set `persist-credentials: false` on actions/checkout wherever later steps do not push
- Decide which AI coding agents and MCP servers may work on the organization's repositories
- Do not restore Actions caches in release and publish workflows
- Disallow self-hosted runners on public repositories
- Limit each self-hosted runner group to the repositories that need it
- Adopt artifact attestations for build provenance on published binaries/images
- Publish packages with trusted publishing (OIDC) instead of long-lived registry tokens
- Write and rehearse a credential-rotation runbook before you need it
- Review every currently installed GitHub App / OAuth App and its granted scope
- Keep OAuth app access restrictions on and require security/IT approval for new apps
- Turn off "Allow GitHub Actions to create and approve pull requests"
Permissions involved
The GitHub permissions those incidents abused.