Skip to content

Update GitHub Actions to use pinned hash references #2505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

wroersma
Copy link
Contributor

Description

This PR updates all GitHub Actions in the workflow files to use specific commit hashes rather than version tags. This follows GitHub's security best practice of using hash-pinned references to prevent potential supply chain attacks.

Security Rationale

The recent tj-actions/changed-files compromise (CVE-2025-30066) demonstrated how attackers can modify version tags to execute malicious code in workflows. Even with the current version tag in your workflows, your repository remains vulnerable to this type of attack.

By pinning to immutable SHA hashes, we ensure that the exact code run by your workflows is never silently changed, protecting against:

  • Compromised maintainer accounts
  • Malicious tag modifications
  • Supply chain attacks

Changes

  • Updated actions/checkout from v3/v4 to specific commit hashes
  • Updated tj-actions/changed-files to a pinned hash reference (especially important given the recent compromise)
  • Updated all other GitHub Actions to their latest hash references
  • Added version comments for easier reference

Impact

This change has no functional impact on your workflows but significantly improves security posture. The specific versions selected match or exceed the functionality of the previously used tag-based versions.

I've created a tool that automates this process: GitHub Workflow Checker which can be used to keep these references updated while maintaining the security benefits.

@wroersma wroersma requested a review from a team as a code owner March 18, 2025 12:58
@MSAdministrator MSAdministrator added this pull request to the merge queue Jun 5, 2025
Merged via the queue into sublime-security:main with commit 4695cef Jun 5, 2025
3 checks passed
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.

4 participants