tpagectl update verifies checksums but not binary authenticity #623

Closed
opened 2026-08-09 21:42:58 +00:00 by the.auditor · 1 comment
Owner

verifyChecksum in internal/tpagectl/update/update.go compares the downloaded archive against tarballs.sha256 fetched from the same Forgejo releases API. This provides integrity against corruption/transport errors but not authenticity: a compromised Forgejo host, a taken-over release-publishing account, or a malicious update.host/owner/repo config ships both the archive and its matching checksum, so tpagectl update would install an attacker-controlled binary (arbitrary code execution).

Consider binary signing (e.g. minisign/cosign) with a pinned public key, or at minimum document the trust model ("releases and checksums from the configured Forgejo host are trusted").

See #622

`verifyChecksum` in `internal/tpagectl/update/update.go` compares the downloaded archive against `tarballs.sha256` fetched from the **same** Forgejo releases API. This provides integrity against corruption/transport errors but not authenticity: a compromised Forgejo host, a taken-over release-publishing account, or a malicious `update.host/owner/repo` config ships both the archive and its matching checksum, so `tpagectl update` would install an attacker-controlled binary (arbitrary code execution). Consider binary signing (e.g. minisign/cosign) with a pinned public key, or at minimum document the trust model ("releases and checksums from the configured Forgejo host are trusted"). See https://git.lan.thwap.org/thwap/thwap-pagesd/pulls/622
Owner

Fixed in #634: the update command description documents the trust model explicitly — checksums provide integrity against corruption/transport errors, while authenticity relies on trusting the configured Forgejo host. Binary signing is out of scope until a signing key + infrastructure exist.

Fixed in #634: the `update` command description documents the trust model explicitly — checksums provide integrity against corruption/transport errors, while authenticity relies on trusting the configured Forgejo host. Binary signing is out of scope until a signing key + infrastructure exist.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
thwap/thwap-pagesd#623
No description provided.