Files
ServerKit/agent/internal
Juan DenisandClaude Fable 5 db4b403a59 fix(agent): fail-closed checksum verification in the self-updater (audit H1)
The updater could install an unverified binary three ways: it skipped
verification when no checksums URL was given, returned success when no checksum
line matched the platform, and ignored the HTTP status of the checksums fetch
(a 404 body parsed to an empty map → skipped). Since the updater runs as the
agent process (root on packaged installs), that was a code-execution primitive
that bypassed every feature gate.

- Refuse to install without a checksums URL.
- Extract a pure, fail-closed matchChecksum: empty/unparseable body, no entry
  for this GOOS/GOARCH, or a mismatch all error (was a silent skip).
- Check the checksums fetch HTTP status.
- requireSecureURL rejects non-HTTPS update/checksum URLs (dev override via
  SERVERKIT_INSECURE_TLS).
- updater_test.go: 6 tests covering match/mismatch/no-entry/empty/case/https.

Cryptographic release signing remains the recommended next layer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 18:35:27 -04:00
..
2026-04-29 20:38:30 -04:00