Skip to content

ci: verify changie download against pinned SHA256 before executing#245

Merged
iainmcgin merged 1 commit into
mainfrom
iain/verify-changie-download
Jun 26, 2026
Merged

ci: verify changie download against pinned SHA256 before executing#245
iainmcgin merged 1 commit into
mainfrom
iain/verify-changie-download

Conversation

@iainmcgin

Copy link
Copy Markdown
Collaborator

Follow-up to #230. Both changie install paths fetched the upstream release tarball and executed it with no integrity check, so a replaced or tampered upstream asset would run unchallenged in CI (with the job's GITHUB_TOKEN) and on developer machines.

  • CI (check-changelog): pin the linux_amd64 tarball's SHA256 directly; download to a temp file, sha256sum -c before extracting, extract to $RUNNER_TEMP/bin and append to $GITHUB_PATH (no more sudo into /usr/local/bin).
  • Taskfile (install-changie): pin the SHA256 of the upstream checksums.txt (one in-repo hash covers all four supported OS/arch tarballs); download tarball + checksums.txt, verify checksums.txt against the pin, then verify the tarball against checksums.txt. Uses shasum -a 256 so it works on both Linux and macOS.

Bumping CHANGIE_VERSION now requires updating the adjacent pin in both files; the comments cross-reference each other.

install-protoc has the identical gap (no checksum on the protoc zip) and predates #230 — left for a separate PR so this one stays a clean #230 follow-up.

Both the check-changelog CI job and task install-changie were fetching
the changie release tarball and executing it with no integrity check, so
a replaced or tampered upstream asset would run unchallenged.

- CI: pin the linux_amd64 tarball SHA256 directly, download to a temp
  file, sha256sum -c before extracting, extract to RUNNER_TEMP/bin (no
  sudo into /usr/local/bin), append to GITHUB_PATH.
- Taskfile: pin the SHA256 of the upstream checksums.txt (one hash
  covers all four supported OS/arch tarballs), download tarball +
  checksums.txt, verify checksums.txt against the pin then the tarball
  against checksums.txt. Uses shasum -a 256 for Linux/macOS portability.

Bumping CHANGIE_VERSION now requires updating the adjacent pin in both
files; comments cross-reference each other.

install-protoc has the same gap and predates this PR; not touched here.
@github-actions

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@iainmcgin iainmcgin changed the title ci,task: verify changie download against pinned SHA256 before executing ci: verify changie download against pinned SHA256 before executing Jun 26, 2026
@iainmcgin iainmcgin marked this pull request as ready for review June 26, 2026 18:39
@iainmcgin iainmcgin requested a review from azdagron June 26, 2026 18:39
@iainmcgin iainmcgin added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 2e806b5 Jun 26, 2026
9 checks passed
@iainmcgin iainmcgin deleted the iain/verify-changie-download branch June 26, 2026 18:52
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants