Skip to content

fix(update): validate release assets before download - #11

Merged
GuoMonth merged 4 commits into
mainfrom
fix/update-require-digest
Apr 17, 2026
Merged

GuoMonth merged 4 commits into
mainfrom
fix/update-require-digest

Conversation

@GuoMonth

@GuoMonth GuoMonth commented Apr 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • require the selected release asset to have a valid sha256 digest before gm update check or gm update apply treats it as installable
  • verify downloaded archives against the parsed digest and reject redirects that leave trusted GitHub hosts
  • make release CI verify that every published asset exposes the exact sha256 digest consumed by the updater
  • document the stricter secure-update behavior and expand tests for missing digests plus redirect policy

Validation

  • go test ./internal/update
  • make validate
  • workflow YAML parsed with Ruby YAML.load_file
  • make check (still fails in this environment because golangci-lint is not configured via asdf: "No version is set for command golangci-lint"; this was already failing before the refactor)

Closes #7
Closes #10

GuoMonth and others added 2 commits April 17, 2026 14:41
Reject release assets whose digest is missing or blank so self-update never installs an unverified archive. Add a regression test that ensures apply aborts before replacing the binary when the release metadata omits a usable digest.

Closes #7

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Promote release-asset validation into the shared selection path used by update check and update apply. Require a valid sha256 digest before an asset is considered installable, verify downloads against the parsed digest, and restrict update redirects to trusted GitHub hosts.

Also document the stricter secure-update contract and expand tests for missing digests and redirect policy.

Closes #10

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GuoMonth GuoMonth changed the title fix(update): require asset digest before apply fix(update): validate release assets before download Apr 17, 2026
GuoMonth and others added 2 commits April 17, 2026 15:07
After uploading tagged release artifacts, query the GitHub release API and ensure each published asset exposes the expected sha256 digest. This keeps the release workflow aligned with the updater's runtime security contract and fails the release if digest metadata is missing or mismatched.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Combine same-type parameters in verifyAssetDigest so golangci-lint passes under the local Go 1.26 toolchain.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@GuoMonth
GuoMonth merged commit 419e98e into main Apr 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security(update): HTTP client follows redirects to any host without allowlist security(update): missing digest silently skips integrity verification

1 participant