Skip to content

fix: pin 8 unpinned action(s)#3753

Open
dagecko wants to merge 1 commit intomodelcontextprotocol:mainfrom
dagecko:runner-guard/fix-ci-security
Open

fix: pin 8 unpinned action(s)#3753
dagecko wants to merge 1 commit intomodelcontextprotocol:mainfrom
dagecko:runner-guard/fix-ci-security

Conversation

@dagecko
Copy link
Copy Markdown

@dagecko dagecko commented Mar 30, 2026

Re-submission of #3724. Had a problem with my fork and had to delete it, which closed the original PR. Apologies for the noise.

Summary

This PR pins all GitHub Actions to immutable commit SHAs instead of mutable version tags.

  • Pin 8 unpinned actions to full 40-character SHAs
  • Add version comments for readability

How to verify

Review the diff, each change is mechanical and preserves workflow behavior:

  • SHA pinning: action@v3 becomes action@abc123 # v3, original version preserved as comment
  • No workflow logic, triggers, or permissions are modified

I've been researching CI/CD supply chain attack vectors and submitting fixes to affected repos. Based on that research I built a scanner called Runner Guard and open sourced it here so you can scan yourself if you want to. I'll be posting more advisories over the next few weeks on Twitter if you want to stay in the loop.

If you have any questions, reach out. I'll be monitoring comms.

- Chris (dagecko)

@cliffhall cliffhall added the bug Something isn't working label Apr 20, 2026
@cliffhall
Copy link
Copy Markdown
Member

@claude review

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Apr 21, 2026

Claude finished @cliffhall's task in 1m 46s —— View job


Code Review

  • Read changed workflow files
  • Verify SHA pinning correctness
  • Check version comments match pinned SHAs
  • Assess security and maintenance implications

Summary

This PR correctly pins the 8 most security-sensitive third-party action instances to full 40-character commit SHAs. The changes are mechanical, internally consistent, and preserve all workflow logic. The approach is sound and the PR is worth merging, with a few observations below.


What's pinned (correct scope)

The PR targets the highest-risk actions — those running with privileged credentials or in publish pipelines:

Action SHA (first 8 chars) Version comment Files
anthropics/claude-code-action 3ac52d0d # v1 claude.yml:35
astral-sh/setup-uv caf0cab7 # v3 python.yml:37,74
astral-sh/setup-uv d4b2f3b6 # v5 release.yml:30,82,126
pypa/gh-action-pypi-publish ed0c5393 # release/v1 python.yml:121, release.yml:146

Consistency check passes: the same SHA is used for the same version in every occurrence across files. The different SHAs for setup-uv@v3 vs setup-uv@v5 in python.yml vs release.yml are expected and correct — they reference different major versions.


Observations

1. SHA verification (maintainer action recommended)
I cannot network-verify these SHAs. Before merging, a maintainer should independently confirm each SHA resolves to the expected version tag/branch:

# Verify each in browser or via API:
# https://github.com/anthropics/claude-code-action/commit/3ac52d0da9f8ec9ca7b4dc23bb477e36ef9c77a9
# https://github.com/astral-sh/setup-uv/commit/caf0cab7a618c569241d31dcd442f54681755d39  (should be v3)
# https://github.com/astral-sh/setup-uv/commit/d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86  (should be v5)
# https://github.com/pypa/gh-action-pypi-publish/commit/ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e

2. Official actions/* actions remain unpinned (pre-existing, low urgency)
The following official GitHub-maintained actions are still pinned to mutable tags — a separate issue from this PR:

  • actions/checkout@v6.github/workflows/claude.yml:29, python.yml:17,34,71, release.yml:18,77,121,161,207
  • actions/setup-python@v6python.yml:40,77, release.yml:129
  • actions/upload-artifact@v6python.yml:94, release.yml:46
  • actions/download-artifact@v7python.yml:115, release.yml:210
  • actions/setup-node@v6release.yml:165

These are maintained by GitHub itself, which significantly reduces (but does not eliminate) the supply chain risk. Pinning them would be completionist but reasonable to do in a follow-up.

3. No Dependabot for Actions (pre-existing)
There is no .github/dependabot.yml in the repo. Without automated SHA-update PRs, these pinned SHAs will silently drift from the latest security-patched versions over time. Consider adding a Dependabot github-actions ecosystem entry after merging:

# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: weekly

Dependabot understands SHA-pinned actions and will keep the SHAs and version comments updated automatically.


Verdict

Approve with the SHA verification caveat above. The PR provides a real security improvement for the most privileged parts of the CI pipeline (the PyPI publish and Claude Code action steps). No workflow logic, triggers, or permissions are changed. The comment annotations (# v1, # v3, etc.) maintain readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants