fix: pin and checksum-verify semver install#90
Merged
Conversation
The Setup Semver step downloaded the semver-tool script from the mutable 'master' branch with no integrity check, then installed it with sudo. A compromise (or repointing) of that upstream ref would execute arbitrary code on the runner. Pin the download to the immutable commit 837ad91 (tag 3.4.0) and verify its SHA-256 before install, failing closed on mismatch. This mirrors the existing jq and gomplate hardening in this action. Also drop the unnecessary sudo on curl; only install needs root. Signed-off-by: Nathan Klick <nathan@swirldslabs.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the composite action’s “Setup Semver” step by removing reliance on a mutable upstream ref and adding integrity verification, aligning the SemVer install flow with the action’s existing pinned-and-verified download patterns.
Changes:
- Pins the
semver-tooldownload to an immutable commit SHA rather thanmaster. - Adds SHA-256 checksum verification (
shasum -a 256 -c -) before installing the script. - Drops
sudofrom thecurldownload step (keepssudoonly forinstall).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
andrewb1269
approved these changes
Jul 15, 2026
This was referenced Jul 16, 2026
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
The Setup Semver step in
action.ymldownloaded thesemver-toolscript from the mutablemasterbranch and installed it withsudo, without any integrity check. Anyone who compromised (or re-pointed) that upstream ref could execute arbitrary code on every runner using this action.This hardens the step to match the existing jq and gomplate installs, which already pin a version and verify a SHA-256 checksum.
Changes
837ad91179c4126e3b7ff73c35091d5ef561d9a3(release tag3.4.0) instead ofmaster. A commit SHA cannot be re-pointed by the upstream owner.1ff4a97e…) withshasum -a 256 -c -beforesudo install, failing closed on mismatch — a second, independent layer against CDN/MITM tampering.sudooncurl— onlyinstallneeds root.SEMVER_COMMITandSEMVER_SHA256together (documented inline).Behavior is unchanged for callers; the
semver-versionoutput still reports the installed version.Verification
OK) and the script runs (semver: 3.4.0).FAILED) — fails closed.action.ymlremains structurally valid YAML with no new lint findings in the edited region.