A single misconfigured GitHub Actions workflow can give an attacker the keys to your entire production environment. Privilege escalation in CI/CD pipelines is not theory—it is a common and exploitable risk. When automated builds touch secrets, deploy code, or manage infrastructure, one gap in controls can turn into full compromise.
GitHub CI/CD is powerful but dangerous without strict privilege boundaries. Minimal access should be the rule. Service accounts need only the permissions required for the job. Disable write access to repositories for workflows that do not need it. Avoid default tokens with broad scopes. Rotate secrets often. Audit permission changes continuously.
Privilege escalation usually happens when an attacker can run arbitrary code inside your pipeline. This can be by pushing to a branch that triggers a privileged workflow, or by modifying a dependency that gets executed during the build. To block this, pin action versions instead of using @latest. Require branch protection for all workflows tied to production. Review all third-party actions for security before use.