GitHub Actions Misconfigurations Expose Secrets and Repository Write Access
Supply Chain Risk · 4 sources · Updated 3mo ago · First seen Jan 1, 2026

Security guidance from GitHub Security Lab and Semgrep warned that unsafe GitHub Actions patterns can let attackers execute code in CI, steal secrets, and modify repositories. A key risk is using the privileged pull_request_target trigger while also checking out code from an untrusted forked pull request, which runs attacker-controlled code with target-repository secrets and potentially write-capable GITHUB_TOKEN permissions. The guidance also highlighted shell injection risks when workflows interpolate untrusted GitHub context fields such as pull request titles directly into run steps, as well as the danger of re-enabling deprecated insecure commands through ACTIONS_ALLOW_UNSECURE_COMMANDS.
The recommended mitigations focus on separating trust boundaries inside workflows. GitHub Security Lab advised using pull_request for untrusted forked PRs because it withholds secrets and write access, reserving pull_request_target only for limited privileged tasks such as labeling or commenting. It also recommended split-workflow designs in which untrusted PR code runs in one workflow and a separate workflow_run job consumes only safe artifact data, while warning that artifacts produced from untrusted PRs must still be treated as untrusted. Additional hardening steps included auditing third-party Actions, carefully handling environment variables and other untrusted inputs, enforcing branch protections, and scanning workflow files with Semgrep rules.


