Repository navigation
ci: pin every workflow and download release artifacts by source - #2794
Merged
Merged
Conversation
ci.yml, codeql.yml, sdk-contract.yml and the foundry-setup action floated: tag and branch action refs, unversioned install-action tools, and 26 checkouts that kept the token, under jobs that write PR comments, code-quality and security events. Every remote action is now pinned by commit SHA, dtolnay/rust-toolchain names its version in `toolchain:`, every tool installs at a fixed version with `fallback: none`, and no checkout persists credentials. check_release_hardening.py becomes check_workflow_hardening.py and reads every workflow: each needs a WRITE_JOBS row, and rule 6 holds the tool pins. Dependabot no longer moves the toolchain through action refs; the toolchain-pin docs say a Rust bump now arrives as the sponsord `rust:` tag. release.yml downloads each artifact into its own directory instead of merging by pattern. upload-assets moves an archive out only when its name carries the target its artifact is named for, docker takes the two Linux artifacts by exact name, and attach reads each digest and SBOM from its own stage's artifact, so an extra artifact cannot overwrite a real file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The hardening check permits checksum verification to be disabled, undermining install integrity, and Windows path separators cause false failures in the pre-commit hook.
No open issues 🎉
What changed in this PR
Extends the release-pipeline hardening from #2783 across all workflows and separates release artifact downloads by source to prevent cross-artifact overwrites.
Changes:
- Pins remaining action references and install-action tool versions, and disables persisted checkout credentials.
- Expands the hardening guard to every workflow, with regression tests and updated CI/pre-commit integration.
- Separates release artifact downloads and documents Rust toolchain update responsibilities.
| File | Description |
|---|---|
RELEASING.md |
References the renamed hardening guard. |
CONTRIBUTING.md |
Explains explicit toolchain inputs and coordinated version bumps. |
CHANGELOG.md |
Records workflow and artifact-download hardening. |
.pre-commit-config.yaml |
Applies the renamed guard to all workflows. |
.github/workflows/sdk-contract.yml |
Pins SDK workflow actions and nextest. |
.github/workflows/release.yml |
Separates artifact downloads and validates archive source names. |
.github/workflows/codeql.yml |
Pins checkout and CodeQL actions. |
.github/workflows/ci.yml |
Pins actions and tools, disables checkout credentials, and invokes the expanded guard. |
.github/scripts/tests/test_solidity_path_filter.py |
Matches paths-filter independently of its pinned reference. |
.github/scripts/tests/test_check_workflow_hardening.py |
Tests workflow registration and tool-pinning rules. |
.github/scripts/check-workflow-hardening.sh |
Invokes the renamed Python checker. |
.github/scripts/check_workflow_hardening.py |
Checks all workflows and validates install-action tool inputs. |
.github/scripts/check_toolchain_pin.py |
Updates documentation of toolchain bump behavior. |
.github/dependabot.yml |
Clarifies toolchain update responsibilities in comments. |
.github/actions/foundry-setup/action.yml |
Pins Foundry setup and cache actions. |
Review effort: Balanced
Gas snapshotNo gas changes vs base. |
Code coverage overviewLanguages: Rust, Solidity Rust / code-coverage/cargo-llvm-cov
Solidity / code-coverage/forge
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
This was referenced Oct 30, 2026
thiras
added a commit
that referenced
this pull request
Nov 1, 2026
…iewing #2794 (#2809) * ci: close workflow-hardening and release archive-check gaps found reviewing #2794 check_workflow_hardening.py rule 6 now refuses `checksum` set to anything but `true`, and reads a wrapped plain or quoted `with:` value as YAML folds it, so a second tool on a continuation line is checked. The docstring and messages narrow to what the guard reads and name the SHA-pinned actions that still install floating code. release.yml's per-artifact archive check refuses a flat download, an empty download, an empty artifact and hidden entries, and names the version in its mismatch message. A new pytest runs the step from release.yml against the build matrix's real layout and each refused one. The toolchain-pin comments describe the post-#2794 path: the `toolchain:` input sets the version and a Rust release arrives as the docker ecosystem's `rust:` bump of deploy/sponsord. Closes #2798 Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: refuse hidden archive names and unclosed quotes in the hardening checks A hidden archive whose name carries the right version and target passed the per-artifact check, and the count and upload globs skip dotfiles, so an impostor artifact went unnoticed. The step now refuses any dot-prefixed name first. check_workflow_hardening.py's with_input strips the folded value before unquoting, so a value on the line after its key reads correctly, and returns a quoted value whose close it did not find with its opening quote, so every comparison fails rather than passing a truncated value. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: tighten hardening-check comments and pin the remaining guards with tests Name every floating download the guard leaves out of scope, the clippy cache's path into the release, rule 5's job keys, and where download-artifact extracts flat. RELEASING.md and CONTRIBUTING.md name the stable toolchain cargo-semver-checks-action installs. Tests pin folding across a blank line, a checksum other than a literal true, and the duplicate-name guard; the wrapper test drops inherited GIT_* variables. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci: read input names case-blind and refuse non-file or untargeted archives The runner matches a step's input names without regard to case, so `Checksum: false` turned checksums off while the hardening check read the input as unset. with_input now compares names case-blind; an expression used as an input name joins the declared out-of-scope shapes. The per-artifact archive check refuses an artifact named `binaries-` with no target, and any entry that is not a regular file: a symlink moved to the top level would be checksummed with another archive's bytes. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
What
These are the two follow-ups from the #2783 reviews.
1. Every workflow is hardened, not only the release ones.
ci.yml,codeql.yml,sdk-contract.ymland thefoundry-setupcomposite action floated in three ways:re-actors/alls-green@release/v1was a branch);tool: cargo-nextest,cargo-llvm-cov);These jobs also write:
code-qualityontest/solidity-coverage,pull-requestsonsolidity-build-test, andsecurity-eventson codeqlanalyze. ci.yml'sclippycache also feeds release.yml'sverify. What changed:# vX.Y.Zcomment. Each floating major resolves today to the same commit as the exact tag pinned.release/v1is identical tov1.3.0.setup-moldhas only av1tag.dtolnay/rust-toolchainis pinned to itsmasterSHA, withtoolchain: 1.99.1added to the existingwith:. This keeps the env that rust-cache hashes identical across ci.yml and release.yml.taiki-e/install-actiontool is installed at a version the pinned install-action's manifest checksums:[email protected],[email protected],[email protected]. Each step setsfallback: none.persist-credentials: false. Nothing needs the token after checkout:paths-filterfetches its base SHA anonymously, and the repo is public;Guard.
check_release_hardening.pybecomescheck_workflow_hardening.py(with its.sh, tests, pre-commit hook andpackagingstep) and reads every workflow:WRITE_JOBSrow, so a new workflow has to declare its write grants. Rows were added for ci.yml, codeql.yml and sdk-contract.yml.[email protected]withfallback: none.mainit reports 138 errors, one for each change in this PR.Toolchain bumps. With every dtolnay ref SHA-pinned, Dependabot's github-actions ecosystem no longer moves the Rust version. A Rust release arrives as the docker ecosystem's
rust:X.Y.Zbump ofdeploy/sponsord, andcheck-toolchain-pin.shholds that PR red until every site moves. The dependabot.yml comment, thecheck_toolchain_pin.pydocstring and CONTRIBUTING.md § Rust Toolchain say so.2. Release artifacts download by source (
release.yml).upload-assetsdownloads eachbinaries-<target>artifact into its own directory instead of merging them. An archive moves out only if its name carries that directory's target. So an extra artifact either holds a file naming another target, which fails, or adds a 16th archive, which the exact count refuses. Either way it can no longer overwrite a real archive during a merge.dockerdownloads the two Linux artifacts by exact name.attachreads each digest and SBOM from its own stage's artifact.A step holding the run's artifact token could still replace a same-named artifact outright. The comment states that, and keeping untrusted code out of the run is the only fix.
Follows #2783.
Reviewer notes
persist-credentials: falseand the pinned tools. Worth checking:changes(paths-filter's git fetch without stored credentials);test/solidity-coverage(upload-code-coverage);binaries-evilholding a linux archive name: fails;binaries-*directory: fails;test_solidity_path_filter.pyfound the paths-filter step by its literal@v4ref. It now matches by action name.Verification
check-workflow-hardening.sh: OK (147 action refs in 5 workflows).check-toolchain-pin.sh(22 sites),check-image-name.shandcheck-binstall-metadata.sh: OK.uvx --python 3.12 --with pyyaml pytest .github/scripts/tests scripts/tests: 475 passed.actionlinton every workflow: only the existingcode-qualityscope and SC2012 findings remain.pre-commit runon the changed files.gh api repos/O/R/commits/<ref>, and every tool version is listed in install-action v2.87.32's manifests.🤖 Generated with Claude Code