Loading...
Loading...
Security hardening reviewer for GitHub Actions workflow files (.github/workflows/*.yml). Reasons about the Actions threat model that pattern matchers and general code linters miss — untrusted-input script injection, privileged triggers running fork code, mutable action references, and over-scoped tokens. Use this skill when asked to review, audit, harden, or secure a GitHub Actions workflow, when writing a new workflow, or for any request like "is this workflow safe?", "review my CI for security issues", "why is pull_request_target dangerous here?", "pin my actions", or "lock down GITHUB_TOKEN permissions". Covers script injection via ${{ }} interpolation, pull_request_target / workflow_run privilege escalation, SHA-pinning of third-party actions, least-privilege permissions, GITHUB_ENV/GITHUB_OUTPUT injection, secret exposure, OIDC over long-lived credentials, and self-hosted runner exposure on public repositories.
npx skill4agent add github/awesome-copilot github-actions-hardening${{ }}.github/workflows/pull_request_targetworkflow_runissue_commentGITHUB_TOKENpermissions:run:${{ <expr> }}- run: echo "Title: ${{ github.event.issue.title }}""; <attacker-command> #${{ }}on:pushpull_requestpull_requestpull_request_targetworkflow_runissue_commentissuesreferences/triggers-and-privilege.mdrun:script:actions/github-script${{ }}github.event.issue.titlegithub.event.issue.bodygithub.event.pull_request.titlegithub.event.pull_request.body.head.ref.head.labelgithub.event.comment.bodygithub.event.review.bodygithub.event.pages.*.page_namegithub.event.commits.*.messagegithub.event.head_commit.*github.head_refgithub.event.*references/injection.mdpull_request_targetworkflow_runref: ${{ github.event.pull_request.head.sha }}npm installpull_requestworkflow_runpermissions:permissions:permissions: {}contents: readpull-requests: writepermissions: write-allwritereferences/permissions-and-tokens.mduses:actions/*github/*v1actions/*@main@masteruses: foo/bar@<sha> # v2.1.0references/supply-chain.mdset -xbash -x$GITHUB_ENV$GITHUB_OUTPUTactions/checkoutpersist-credentials: falsereferences/report-format.md| Severity | Meaning | Example |
|---|---|---|
| 🔴 CRITICAL | Token/secret theft or RCE reachable by an outside contributor | |
| 🟠 HIGH | Exploitable supply-chain or scope problem | Third-party action on a mutable tag/branch; |
| 🟡 MEDIUM | Risk under conditions or chaining | Missing |
| 🔵 LOW | Hardening gap, low direct risk | First-party action not SHA-pinned; |
| ⚪ INFO | Observation, not a vulnerability | Version comment missing next to a pinned SHA |
pull_requestreferences/triggers-and-privilege.mdpull_request_targetworkflow_runpull_request_targetworkflow_runissue_commentforksecretsread-only tokentrust boundaryreferences/injection.md${{ }}env:rungithub-scriptscript injectiongithub.eventhead_refissue titleenvintermediate variableactions/github-scriptreferences/permissions-and-tokens.mdGITHUB_TOKENpermissions:permissionsGITHUB_TOKENwrite-allcontents: readid-tokenOIDCleast privilegereferences/supply-chain.mdgithub-actionsworkflow_runSHA pinusesmutable tagDependabotdownload-artifactcacheself-hosted runnerreferences/report-format.mdreportformatfindingsummaryremediationbeforeafter