Skip to content

fix(ci): pin third-party GitHub Actions to SHA to prevent supply chain attacks - #8318

Closed
memosr wants to merge 1 commit into
NousResearch:mainfrom
memosr:fix/pin-github-actions-sha
Closed

fix(ci): pin third-party GitHub Actions to SHA to prevent supply chain attacks#8318
memosr wants to merge 1 commit into
NousResearch:mainfrom
memosr:fix/pin-github-actions-sha

Conversation

@memosr

@memosr memosr commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

.github/workflows/docker-publish.yml and tests.yml used mutable
version tags for third-party GitHub Actions:

# Before (vulnerable)
uses: docker/build-push-action@v6
uses: astral-sh/setup-uv@v5

Mutable tags can be silently redirected to malicious commits. If an
attacker compromises the docker or astral-sh GitHub organization,
they can push a backdoored commit to the same tag — and the next CI
run will execute it with access to secrets.DOCKERHUB_TOKEN.

Attack scenario

  1. Attacker compromises docker/build-push-action and redirects @v6
    to a malicious commit
  2. docker-publish.yml runs and the malicious action has access to
    ${{ secrets.DOCKERHUB_TOKEN }} and ${{ secrets.DOCKERHUB_USERNAME }}
  3. Attacker pushes a backdoored image as nousresearch/hermes-agent:latest
  4. Hundreds of thousands of users pull the compromised image

Fix

Pinned all third-party actions to their full commit SHA with a version
comment for readability:

Action Old New
docker/setup-qemu-action @v3 @SHA # v3
docker/setup-buildx-action @v3 @SHA # v3
docker/build-push-action @v6 @SHA # v6
docker/login-action @v3 @SHA # v3
astral-sh/setup-uv @v5 @SHA # v5

actions/checkout@v4 (first-party GitHub action) not changed —
first-party actions are trusted.

Type of Change

  • 🔒 Security fix (supply chain attack prevention)

Checklist

  • Read the Contributing Guide
  • Commit messages follow Conventional Commits
  • SHA comments preserve version readability
  • No behavior change — same action versions, just pinned

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the security-conscious contribution, @memosr! 🔒

This is an automated hermes-sweeper review.

The fix you proposed is already reflected on main — both workflow files now use full commit SHA pins with version comments:

  • .github/workflows/docker-publish.yml: docker/setup-qemu-action, docker/setup-buildx-action, docker/build-push-action, and docker/login-action are all pinned to full SHAs with # vN comments.
  • .github/workflows/tests.yml: astral-sh/setup-uv and actions/checkout are both SHA-pinned.

This PR's changes are fully superseded by the current state of main, so we're closing it. The supply chain hardening you advocated for is in place — appreciate the report!

@teknium1 teknium1 closed this Apr 28, 2026
@alt-glitch alt-glitch added type/security Security vulnerability or hardening P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Apr 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Superseded by #9801 (merged) — comprehensive supply chain hardening that covers all actions pinned here.

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

Labels

duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants