Skip to content

ci: pin third-party GitHub Actions to full-length commit SHAs - #62

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-i8ualy
Open

ci: pin third-party GitHub Actions to full-length commit SHAs#62
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-i8ualy

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

Both workflow files referenced third-party GitHub Actions by mutable version tag (@v4, @v5, etc.) rather than an immutable commit SHA. A tag can be repointed to a different commit at any time — by the maintainer or by an attacker who compromises the action's publishing credentials — and the next CI run would silently pull the new code with no diff in this repo to review. deploy-docs.yml runs with pages: write / id-token: write, so a compromised action there could push arbitrary content to the live docs site. This mirrors the mechanism behind the March 2025 tj-actions/changed-files supply-chain compromise.

  • Pinned every uses: line in .github/workflows/validate-openapi.yml and .github/workflows/deploy-docs.yml to the full 40-character commit SHA it currently resolves to, with the version kept as a trailing comment for readability.
  • Picked the latest available tag for each action (checkout v7.0.1, setup-node v7.0.0, configure-pages v6.0.0, upload-pages-artifact v5.0.0, deploy-pages v5.0.0), which also supersedes the 5 open Dependabot version-bump PRs (chore(deps): bump actions/deploy-pages from 4 to 5 #51chore(deps): bump actions/checkout from 4 to 7 #55) referencing these same lines at older target versions.
  • No functional change — same actions, same versions used going forward, just pinned by SHA. Dependabot's github-actions ecosystem (already configured in .github/dependabot.yml) natively keeps SHA-pinned actions up to date, updating both the SHA and the version comment in future PRs.

Fixes #57

Test plan

  • python3 -c "import yaml; yaml.safe_load(open(f))" on both workflow files to confirm valid YAML
  • Verified each SHA against git ls-remote --tags for the corresponding upstream repo to confirm it matches the intended release tag
  • CI (Validate OpenAPI Specs) runs on this PR and passes with the pinned actions/checkout / actions/setup-node

Generated by Claude Code

Mutable version tags (@v4, @v5, etc.) can be repointed to a different
commit at any time by the action maintainer or an attacker who
compromises the action's publishing credentials, letting CI silently
pull unreviewed code on the next run. deploy-docs.yml runs with
pages: write / id-token: write, so a compromised action there could
push arbitrary content to the live docs site. Pin every uses: line in
both workflows to the commit SHA it currently resolves to, with the
version kept as a trailing comment; Dependabot's github-actions
ecosystem (already configured) natively keeps SHA-pinned actions
updated.

Fixes #57

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RRpaudJJXHRQu1pBS3dc3t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin third-party GitHub Actions to full-length commit SHAs (supply-chain hardening)

2 participants