LC-210-BINARY-INTEGRITY: verify desktop update artifact signature/checksum before self-replace #277
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The desktop self-updater downloads a release binary and self-replaces the running executable with no signature or checksum verification. LC-210 closed the SSRF / redirect-target vector on the fetch, but integrity of the artifact is still unverified: a redirect to a public attacker-controlled host, or a compromised update mirror, still serves a binary that
apply()willchmod +xand swap in to run with the user's privileges. The SSRF guard is necessary but not sufficient.This is the deferral named in the LC-210 PR's "what this PR does NOT close" section (#276). It was recommended for its own follow-up ticket and was never filed.
Where
desktop/src/update.rs::apply(lines ~140-179): streamsartifact.urlto a temp file, sets mode 0o755, callsself_replace::self_replace(&tmp_path). No hash check, no signature check between download and replace.desktop/src/update.rs::fetch_manifest(lines ~74-81): the manifest itself is unsigned, so even a per-artifact hash carried in the manifest is only as trustworthy as the manifest fetch.Failure mode
Supply-chain RCE on the update path. Any of: a mirror compromise, a TLS-trust break, or an operator pointing
LETS_CHAT_UPDATE_URLat a host that is later compromised, results in an attacker binary being executed on the next--update.Proposed scope
version+ per-platformurl+ per-platformsha256.apply(): verify the manifest signature, then verify the downloaded artifact's sha256 against the signed manifest value, BEFOREchmod +x/self_replace. Fail closed on any mismatch.Acceptance
apply()refuses to replace the running binary unless both the manifest signature and the artifact hash verify. Covered by tests. Out of scope: TUF-style full update framework; this is the minimum sign-and-verify.Anchored to LC-210 (desktop self-updater). Severity: security (highest of the post-arc sweep), though exploitation requires mirror compromise or a TLS break.