fix(security): pin third-party GitHub Actions to commit SHAs in CI/release workflows#6229
Open
XananasX7 wants to merge 1 commit into
Open
Conversation
Unpinned tag references for third-party actions can be silently mutated. Pin each action to its commit SHA so the workflow is immune to tag redirection attacks that could exfiltrate PYPI_TOKEN / RELEASE_PAT or inject malicious code into CI. Actions pinned: - astral-sh/setup-uv@v7 → @94527f2e458b27549849d47d273a16bec83a01e9 - actions/checkout@v6 → @df4cb1c069e1874edd31b4311f1884172cec0e10 - actions/setup-python@v6 → @ece7cb06caefa5fff74198d8649806c4678c61a1 - pre-commit/action@v3.0.1 → @2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Summary
Mutable tag references for third-party Actions in the release-publish and continuous-integration workflows introduce a supply-chain risk: if the upstream tag is silently moved (e.g. via a compromised maintainer account, a typosquat, or a direct repo compromise), a malicious version of the action will run with full access to repository secrets on the next triggered run.
Affected Workflows
release-publish.yml(HIGH)astral-sh/setup-uv@v7@94527f2e…actions/checkout@v6@df4cb1c0…actions/setup-python@v6@ece7cb06…This workflow has
contents: writepermission and accessesPYPI_TOKEN(publishes to PyPI) andRELEASE_PAT(full GitHub PAT). A compromisedastral-sh/setup-uv@v7tag could exfiltrate both secrets, enabling a supply-chain attack on every downstream user ofgoogle-adk.continuous-integration.yml(MEDIUM)pre-commit/action@v3.0.1@2c7b3805…astral-sh/setup-uv@v7@94527f2e…actions/checkout@v6@df4cb1c0…actions/setup-python@v6@ece7cb06…CI runs on every PR/push and has access to
GITHUB_TOKEN. A compromised action here could exfiltrate tokens and inject malicious code into CI artifacts.Fix
Pin every action to its exact commit SHA (with the human-readable tag preserved as a comment). This is the approach recommended by GitHub's own security hardening guide and OpenSSF Scorecards.
This change has zero functional impact — the same action code runs, only the resolution is now deterministic and tamper-proof.