[PR #1014] [MERGED] Launcher and horizon-server update: install only releases whose signed checksums match #2989

Closed
opened 2026-11-02 16:00:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1014
Author: @ludovic111
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @ludovic111

Base: main ← Head: feat/verify-signed-updates


📝 Commits (2)

  • 3690885 Launcher and horizon-server update: install only releases whose signed checksums match
  • 846f681 Signed updates: releases from before signing stay installable with pinned files; tests need a release key

📊 Changes

16 files changed (+873 additions, -57 deletions)

View changed files

📝 .github/workflows/launcher.yml (+1 -0)
📝 Cargo.lock (+1 -0)
➕ crates/horizon-release-sign/legacy-releases.txt (+427 -0)
📝 crates/horizon-release-sign/src/lib.rs (+51 -0)
📝 crates/horizon-server/Cargo.toml (+2 -1)
📝 crates/horizon-server/src/update.rs (+132 -38)
📝 docs/release-flow.md (+7 -0)
📝 docs/server.md (+4 -2)
📝 launcher/Cargo.lock (+9 -0)
📝 launcher/Cargo.toml (+2 -0)
📝 launcher/src/backend.rs (+58 -12)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/main.rs (+5 -4)
➕ launcher/src/signed.rs (+96 -0)
➕ tools/ci/legacy_releases.py (+76 -0)
📝 tools/release_train.py (+1 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Security brief (Ludovic, 2026-10-19), item 2, second half. Based on main (#1011 and the key, #1023, are merged). Draft on purpose.

Merge only when all of these are true

  1. A signed stable game release exists: GitHub's latest release has SHA256SUMS and SHA256SUMS.sig, and horizon-release-sign verify --tag <tag> <its files> passes with the built-in key. Today's latest, v2026.10.19.11, is unsigned.
  2. A signed launcher release exists: the newest launcher-v* release has both files and passes the same check.
  3. python3 tools/ci/legacy_releases.py --check passes on the branch at merge time. If an unsigned release came out after this was written, rerun the script without --check and push.
  4. End to end: horizon-launcher install latest and horizon-server update --check on a branch build install the signed release. Installing an old release by tag also works.
  5. verify is green. The two *_ships_with_a_release_key tests fail whenever release-keys.txt lists no key, so this can never ship refusing everything.

Rollback to unsigned old releases

They stay reachable. The SHA-256 of every archive of the 131 releases published before signing (423 files) is pinned in crates/horizon-release-sign/legacy-releases.txt and built into the launcher and the server. Those releases install only with exactly those files. A rollback works, and swapping an old release's files later still fails. The digests are the ones GitHub computed at upload, taken today, so they're trusted as of today.

What

  • Launcher (launcher/src/signed.rs + backend). Game installs and the launcher's self-update first fetch the release's SHA256SUMS and SHA256SUMS.sig from GitHub's fixed download address. They check the signature against the keys built in from release-keys.txt, then hash the archive while it downloads and compare it to the signed SHA-256. A release that is unsigned, signed for another tag (replay), signed by another key, doesn't list this platform's archive, or doesn't match is refused, and the file is deleted. The message is shown where install errors already appear, e.g. "v… is not signed, and Horizon installs only signed releases: pick a newer version." A failed fetch of the checksums is an error, never a pass. There is no bypass switch.
  • horizon-server update: the SHA-256 now comes from the release's signed SHA256SUMS instead of GitHub's digest field. Unsigned or wrongly signed releases are refused the same way. It still follows releases/latest (stable).
  • Pinned old releases: legacy_digest(tag, asset) is checked first. A release from before signing gets its pinned SHA-256 whatever files it carries now. tools/ci/legacy_releases.py [--check] writes or checks the file. docs/release-flow.md explains it.
  • crates/horizon-release-sign/ added to the launcher's paths (release_train.py LAUNCHER_PATHS, launcher.yml).
  • docs/server.md: what update checks.

How tested

  • cargo test --features gpui/runtime_shaders --lib signed in launcher/: 3 pass. only_archives_signed_by_a_built_in_key_install (signed OK; another tag, another key, an unlisted archive, unsigned and offline all refused), releases_from_before_signing_install_only_with_their_pinned_files and the_launcher_ships_with_a_release_key.
  • cargo test -p horizon-release-sign -p horizon-server: all pass, including releases_from_before_signing_keep_their_pinned_digests (the file is well-formed, with no duplicates) and a_release_from_before_signing_is_picked_with_its_pinned_digest. Before rebasing on #1023, horizon_server_ships_with_a_release_key failed as intended.
  • cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings in launcher/: clean. The checksum URLs are derived from the tag rather than stored in Release, which kept clippy's large_enum_variant quiet.
  • cargo test -p horizon-server update: 7 pass, including the rewritten the_archive_for_this_computer_is_picked_with_its_signed_digest (signed, another key, unsigned, replayed under another tag). cargo clippy -p horizon-server -p horizon-release-sign --all-targets -D warnings and cargo fmt --all --check are clean.
  • End to end: merge condition 4 above.

Not covered (left for later)

packaging/server/install.sh / install.ps1 still check GitHub's published SHA-256, because Ed25519 needs OpenSSL 3, which macOS doesn't ship. The first horizon-server update after an install checks signatures.

Label feature: players see a new refusal message if a download is ever tampered with.

Merge conditions, checked 2026-10-21 (agent, on the Mac mini, rebased on main 1225f89e)

  1. Signed stable game release: GitHub's latest is v2026.10.19.15; horizon-release-sign verify --tag v2026.10.19.15 --key MU4o…0gw= → "4 files match SHA256SUMS". ✅
  2. Signed launcher release: launcher-v0.16.0, same check → "4 files match SHA256SUMS". ✅
  3. python3 tools/ci/legacy_releases.py --check → "up to date (423 files)". ✅
  4. End to end, launcher and horizon-server built from this branch (debug), scratch HORIZON_LAUNCHER_HOME and a scratch install layout (releases/<tag>, current):
    • horizon-launcher install latest → installed v2026.10.19.15; install v2026.10.18.15 (pinned, from before signing) → installed; install v2026.10.21 (signed beta) → installed.
    • horizon-server update --check on v2026.10.18.15 → "Horizon v2026.10.19.15 is out"; update → downloaded, checked, switched; update --version v2026.10.18.14 (pinned) → switched.
    • Tampering, with a local-only build whose only change sends github.com/ludovic111/horizon/releases/download/ to a local HTTP mirror of v2026.10.19.15 (never committed):
      mirror launcher install horizon-server update
      genuine files installed switched
      SHA256SUMS edited (macOS line), genuine .sig refused: "signature doesn't match Horizon's release key", nothing installed refused, same message, nothing downloaded
      archive one byte longer, genuine SUMS and .sig refused: "doesn't match its signed checksum", file deleted refused: SHA-256 mismatch, not installed
      no SHA256SUMS.sig (404) refused: "is not signed" refused (the .sig the API lists answers 404)
  5. Launcher cargo test --features gpui/runtime_shaders (78 + 12 + 1 passed), clippy -D warnings clean, fmt clean; cargo test -p horizon-release-sign -p horizon-server pass (one flaky main test, writes_properties_and_syncs_back, shares a temp folder with a settings test: fixed in #1074), clippy clean.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1014 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/verify-signed-updates` --- ### 📝 Commits (2) - [`3690885`](https://github.com/horizon-rust/horizon/commit/36908858a3d793b0049eeeba046222f27d6474f1) Launcher and horizon-server update: install only releases whose signed checksums match - [`846f681`](https://github.com/horizon-rust/horizon/commit/846f681b9afcce2d083d04e83d24695f90df508b) Signed updates: releases from before signing stay installable with pinned files; tests need a release key ### 📊 Changes **16 files changed** (+873 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/launcher.yml` (+1 -0) 📝 `Cargo.lock` (+1 -0) ➕ `crates/horizon-release-sign/legacy-releases.txt` (+427 -0) 📝 `crates/horizon-release-sign/src/lib.rs` (+51 -0) 📝 `crates/horizon-server/Cargo.toml` (+2 -1) 📝 `crates/horizon-server/src/update.rs` (+132 -38) 📝 `docs/release-flow.md` (+7 -0) 📝 `docs/server.md` (+4 -2) 📝 `launcher/Cargo.lock` (+9 -0) 📝 `launcher/Cargo.toml` (+2 -0) 📝 `launcher/src/backend.rs` (+58 -12) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/main.rs` (+5 -4) ➕ `launcher/src/signed.rs` (+96 -0) ➕ `tools/ci/legacy_releases.py` (+76 -0) 📝 `tools/release_train.py` (+1 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Security brief (Ludovic, 2026-10-19), item 2, second half. Based on main (#1011 and the key, #1023, are merged). **Draft on purpose.** ## Merge only when all of these are true 1. **A signed stable game release exists**: GitHub's latest release has `SHA256SUMS` and `SHA256SUMS.sig`, and `horizon-release-sign verify --tag <tag> <its files>` passes with the built-in key. Today's latest, v2026.10.19.11, is unsigned. 2. **A signed launcher release exists**: the newest `launcher-v*` release has both files and passes the same check. 3. **`python3 tools/ci/legacy_releases.py --check` passes** on the branch at merge time. If an unsigned release came out after this was written, rerun the script without `--check` and push. 4. **End to end**: `horizon-launcher install latest` and `horizon-server update --check` on a branch build install the signed release. Installing an old release by tag also works. 5. `verify` is green. The two `*_ships_with_a_release_key` tests fail whenever `release-keys.txt` lists no key, so this can never ship refusing everything. ## Rollback to unsigned old releases They stay reachable. The SHA-256 of every archive of the 131 releases published before signing (423 files) is pinned in `crates/horizon-release-sign/legacy-releases.txt` and built into the launcher and the server. Those releases install only with exactly those files. A rollback works, and swapping an old release's files later still fails. The digests are the ones GitHub computed at upload, taken today, so they're trusted as of today. ## What - **Launcher** (`launcher/src/signed.rs` + backend). Game installs and the launcher's self-update first fetch the release's `SHA256SUMS` and `SHA256SUMS.sig` from GitHub's fixed download address. They check the signature against the keys built in from `release-keys.txt`, then hash the archive while it downloads and compare it to the signed SHA-256. A release that is unsigned, signed for another tag (replay), signed by another key, doesn't list this platform's archive, or doesn't match is refused, and the file is deleted. The message is shown where install errors already appear, e.g. "v… is not signed, and Horizon installs only signed releases: pick a newer version." A failed fetch of the checksums is an error, never a pass. There is no bypass switch. - **`horizon-server update`**: the SHA-256 now comes from the release's signed SHA256SUMS instead of GitHub's `digest` field. Unsigned or wrongly signed releases are refused the same way. It still follows `releases/latest` (stable). - **Pinned old releases**: `legacy_digest(tag, asset)` is checked first. A release from before signing gets its pinned SHA-256 whatever files it carries now. `tools/ci/legacy_releases.py [--check]` writes or checks the file. docs/release-flow.md explains it. - `crates/horizon-release-sign/` added to the launcher's paths (release_train.py LAUNCHER_PATHS, launcher.yml). - docs/server.md: what `update` checks. ## How tested - `cargo test --features gpui/runtime_shaders --lib signed` in launcher/: 3 pass. `only_archives_signed_by_a_built_in_key_install` (signed OK; another tag, another key, an unlisted archive, unsigned and offline all refused), `releases_from_before_signing_install_only_with_their_pinned_files` and `the_launcher_ships_with_a_release_key`. - `cargo test -p horizon-release-sign -p horizon-server`: all pass, including `releases_from_before_signing_keep_their_pinned_digests` (the file is well-formed, with no duplicates) and `a_release_from_before_signing_is_picked_with_its_pinned_digest`. Before rebasing on #1023, `horizon_server_ships_with_a_release_key` failed as intended. - `cargo clippy --features gpui/runtime_shaders --all-targets -- -D warnings` in launcher/: clean. The checksum URLs are derived from the tag rather than stored in `Release`, which kept clippy's `large_enum_variant` quiet. - `cargo test -p horizon-server update`: 7 pass, including the rewritten `the_archive_for_this_computer_is_picked_with_its_signed_digest` (signed, another key, unsigned, replayed under another tag). `cargo clippy -p horizon-server -p horizon-release-sign --all-targets -D warnings` and `cargo fmt --all --check` are clean. - End to end: merge condition 4 above. ## Not covered (left for later) `packaging/server/install.sh` / `install.ps1` still check GitHub's published SHA-256, because Ed25519 needs OpenSSL 3, which macOS doesn't ship. The first `horizon-server update` after an install checks signatures. Label `feature`: players see a new refusal message if a download is ever tampered with. ## Merge conditions, checked 2026-10-21 (agent, on the Mac mini, rebased on main 1225f89e) 1. Signed stable game release: GitHub's latest is v2026.10.19.15; `horizon-release-sign verify --tag v2026.10.19.15 --key MU4o…0gw=` → "4 files match SHA256SUMS". ✅ 2. Signed launcher release: launcher-v0.16.0, same check → "4 files match SHA256SUMS". ✅ 3. `python3 tools/ci/legacy_releases.py --check` → "up to date (423 files)". ✅ 4. End to end, launcher and horizon-server built from this branch (debug), scratch `HORIZON_LAUNCHER_HOME` and a scratch install layout (`releases/<tag>`, `current`): - `horizon-launcher install latest` → installed v2026.10.19.15; `install v2026.10.18.15` (pinned, from before signing) → installed; `install v2026.10.21` (signed beta) → installed. - `horizon-server update --check` on v2026.10.18.15 → "Horizon v2026.10.19.15 is out"; `update` → downloaded, checked, switched; `update --version v2026.10.18.14` (pinned) → switched. - Tampering, with a local-only build whose only change sends `github.com/ludovic111/horizon/releases/download/` to a local HTTP mirror of v2026.10.19.15 (never committed): | mirror | launcher `install` | `horizon-server update` | |---|---|---| | genuine files | installed | switched | | SHA256SUMS edited (macOS line), genuine .sig | refused: "signature doesn't match Horizon's release key", nothing installed | refused, same message, nothing downloaded | | archive one byte longer, genuine SUMS and .sig | refused: "doesn't match its signed checksum", file deleted | refused: SHA-256 mismatch, not installed | | no SHA256SUMS.sig (404) | refused: "is not signed" | refused (the .sig the API lists answers 404) | 5. Launcher `cargo test --features gpui/runtime_shaders` (78 + 12 + 1 passed), clippy `-D warnings` clean, fmt clean; `cargo test -p horizon-release-sign -p horizon-server` pass (one flaky main test, `writes_properties_and_syncs_back`, shares a temp folder with a settings test: fixed in #1074), clippy clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 16:00:39 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#2989
No description provided.