Menu

An Auto-Updater That Doesn't Trust Its Download Server: minisign, Verify-Before-Parse and Rollback Protection
📰

An Auto-Updater That Doesn't Trust Its Download Server: minisign, Verify-Before-Parse and Rollback Protection

DEV Community: rust·c-wind·about 14 hours ago
#s6PR9Mnk
#devtorust#devto#dev#manifest#signature
Reading 0:00
15s threshold

Originally published on MistLab . Part 7 of Building an SSH Terminal .

Part 7 of "Building an SSH Terminal". Code excerpts are from MistTerm v1.2.26, an open-source (AGPL) SSH terminal client by MistLab; they are trimmed, and source comments are translated from Chinese.

TL;DR

HTTPS authenticates the download server, not the update itself. A secure updater accepts an update only if it is signed by a key the client already ships. MistTerm signs a JSON manifest with minisign (Ed25519), verifies the signature before parsing anything, binds each binary to the manifest by SHA-256, and remembers the highest verified version to reject replayed old manifests.

An SSH client holds the keys to its users' servers. That makes its update channel a high-value target. Anyone who can make the client install a binary of their choice owns every machine the user connects to. HTTPS alone does not cover this. It authenticates the server you download from, not the content .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.