Repository navigation
ci: pin the third-party actions that run with secrets and write access - #3775
Merged
Merged
Conversation
KuSh
force-pushed
the
ci/pin-privileged-actions
branch
from
August 30, 2026 13:06
e658766 to
9b85b96
Compare
3 tasks
KuSh
force-pushed
the
ci/pin-privileged-actions
branch
3 times, most recently
from
September 17, 2026 22:59
bbdb204 to
73b1983
Compare
26b96ec pinned pr-target-check.yml, and next-release.yml matches it. Both are pull_request_target workflows that read secrets.APP_PRIVATE_KEY and mint a write-scoped token, which is where a repointed tag does the most damage. Two workflows in the same position were never covered: cd.yml contents: write, pull-requests: write, reads APP_PRIVATE_KEY, and calls googleapis/release-please-action on a floating tag release.yml contents: write, builds and publishes the binaries users install, through softprops/action-gh-release and dtolnay/rust-toolchain A tag is mutable, so whoever owns the action repository can repoint it and have the new code run against that key, or against the build that produces the release artifacts. A commit SHA cannot be repointed. googleapis/release-please-action 5c625bf # v4.4.1 softprops/action-gh-release 3bb1273 # v2.6.2 dtolnay/rust-toolchain 4360b52 # stable branch, untagged actions/create-github-app-token bcd2ba4 # v3.2.0 Each SHA was resolved from the ref it replaces and annotated with the version that actually points at it. rust-toolchain is the exception: `stable` is a branch selecting the Rust toolchain, and the repository's only tag, v1, points at a different commit, so there is no version to name. ci.yml is left on tags on purpose. It runs on pull_request with contents: read and no secrets, so pinning it would buy little and stop the toolchain and cache actions receiving fixes. actions/* is not exempt either; the line is privilege, not who owns the repository. 26b96ec already pins create-github-app-token and github-script, the two that mint a write-scoped token or run script with secrets in reach, while checkout, upload-artifact, download-artifact, setup-go and stale stay on tags because none of them touch a credential. cd.yml and release.yml hold the three create-github-app-token references 26b96ec did not reach, so one action, one key and one set of scopes were split across two treatments. v3 and v3.2.0 both point at bcd2ba4 today, so this pins the code already running. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
KuSh
force-pushed
the
ci/pin-privileged-actions
branch
from
October 8, 2026 17:49
73b1983 to
a7c5a2a
Compare
Merged
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.
26b96ec("fix(security): pin workflow actions to SHA") pinnedpr-target-check.yml, andnext-release.ymlmatches it. Both arepull_request_targetworkflows that readsecrets.APP_PRIVATE_KEYand mint a write-scoped token — where a repointed tag does the most damage.Two workflows in the same position were never covered:
cd.ymlcontents: write,pull-requests: write, readsAPP_PRIVATE_KEYgoogleapis/release-please-action@v4release.ymlcontents: write, builds and publishes the binaries users installsoftprops/action-gh-release@v2,dtolnay/rust-toolchain@stableA tag is mutable, so whoever owns the action repository can repoint it and have the new code run against that key — or against the build that produces the release artifacts.
Each SHA was resolved from the ref it replaces, dereferencing annotated tags to their commit, and annotated with the version that actually points at it.
dtolnay/rust-toolchainis the exception worth noting:stableis a branch selecting the Rust toolchain, not a release, and the repository's only tag (v1) points at a different commit (6c977a6). There is no version to name, so the comment names the branch. Pinning its head preserves behaviour — that branch'saction.ymldefaultstoolchain: stable, and the toolchain is still resolved at run time.Deliberately not included
ci.ymlstays on tags. It runs onpull_requestwithcontents: readand no secrets, so pinning it would buy little and stop the toolchain and cache actions receiving fixes.actions/*is GitHub's own and stays on tags throughout.