ci: pin third-party actions to commit SHA#1396
Merged
Merged
Conversation
Found during a follow-up audit after #1393. Pins the five third-party (non-actions/*, non-docker/*) GitHub Actions used across this repo's workflows to the commit SHA their mutable tag currently resolves to: - dtolnay/rust-toolchain@stable -> @4be7066a (branch, not a tag) - azure/setup-helm@v4 -> @1a275c3b (v4.3.1) - aws-actions/configure-aws-credentials@v4 -> @7474bc46 (v4.3.1) - Swatinem/rust-cache@v2 -> @e18b4977 (v2, 2026-03-12) - helm/chart-releaser-action@v1.6.0 -> @a917fd15 (already a full semver tag, but tags are still mutable refs an attacker with push access to the upstream repo could retarget) Rationale: a tag (branch or lightweight/annotated) can be moved by anyone with push access to the upstream action repo, silently swapping in malicious code the next time a workflow run pulls it. A commit SHA is immutable. This is the mitigation GitHub's own security hardening guide recommends for any third-party action, and is already how this repo pins actions/checkout, docker/*, etc. via major version tags maintained by GitHub/Docker directly (lower-risk, first-party) -- third-party individual/org-maintained actions get the stricter treatment. Each pin keeps the version as a trailing comment for human readability and to make future version bumps a one-line diff. No behavior change -- every SHA is the exact commit the previous tag pointed to at time of audit, verified via the GitHub API tags list endpoint (returns commit SHA directly, avoiding annotated-tag object SHA confusion).
chaodu-agent
added a commit
to openabdev/ghpool
that referenced
this pull request
Jul 14, 2026
…pin actions (#37) Follow-up to a workflow-security audit across oablab/chi, oablab/ecsctl, and openabdev/ghpool (companion of openabdev/openab#1393/#1395/#1396, which fixed the same pattern in openab's release-pr.yml). release-pr.yml and release.yml expanded ${{ inputs.version }}, ${{ inputs.tag }}, and ${{ steps.*.outputs.* }} directly inside run: shell blocks across five jobs (resolve-version, create-release, build, docker, docker-manifest). Actions expands ${{ }} before bash ever sees the script, so a crafted version/tag string can break out of the shell string context. Threat model: release-pr.yml is workflow_dispatch-only (requires repo write access + carries an App token with contents:write + pull-requests:write via steps.app-token.outputs.token). release.yml triggers on 'push: tags' too, which is also gated on write access to push a tag. Same insider/leaked-credential threat model as openab's release-pr.yml. Fix: every inputs.*/steps.*.outputs.* reference in a run: block now goes through env: and is referenced as "$VAR" in shell, matching the canonical pattern already applied across openab's workflows. No behavioral change. Also SHA-pins dtolnay/rust-toolchain@stable and Swatinem/rust-cache@v2 across ci.yml, e2e.yml, and release.yml (same rationale as openabdev/openab#1396: a mutable tag/branch ref can be moved by anyone with push access to the upstream action repo; a commit SHA cannot). Version kept as a trailing comment for readability. Co-authored-by: chaodu-agent <chaodu-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Pins the five third-party (non-
actions/*, non-docker/*) GitHub Actions used in this repo's workflows to an immutable commit SHA, found during a follow-up audit after #1393.dtolnay/rust-toolchain@stable(a branch, not a tag)@4be7066aazure/setup-helm@v4@1a275c3b(v4.3.1)aws-actions/configure-aws-credentials@v4@7474bc46(v4.3.1)Swatinem/rust-cache@v2@e18b4977(v2, 2026-03-12)helm/chart-releaser-action@v1.6.0@a917fd15(v1.6.0)Each occurrence (18 total across 11 workflow files) keeps the version as a trailing comment for readability and to keep future bumps a one-line diff.
Why
A tag — branch, lightweight, or annotated — can be moved by anyone with push access to the upstream action repo, silently swapping in different (potentially malicious) code the next time a workflow pulls it. A commit SHA is immutable regardless of what happens upstream. This is the mitigation GitHub's own Actions security hardening guide recommends for third-party actions specifically.
helm/chart-releaser-action@v1.6.0is already a full semver tag rather than a rolling major version, but the tag itself is still a mutable ref, so it's included for consistency.First-party actions (
actions/*maintained by GitHub,docker/*maintained by Docker) are left on major-version tags — lower supply-chain risk than individually- or org-maintained third-party actions, and this repo already follows that convention.Verification
gh api repos/<owner>/<repo>/tags(returns commit SHA directly — avoids the annotated-tag object-SHA vs. commit-SHA confusion some other lookup paths hit) and cross-checked against the tag name it corresponds toactionlintclean on the diff (one pre-existing unrelated finding onbuild-oabctl.yml— an empty-stringchoiceoption — predates this change and is out of scope)