Full name: The Update Framework.
What it is
TUF (The Update Framework) is a design for software update systems that limits damage when some signing keys are stolen. Justin Samuel, Nick Mathewson, Justin Cappos and Roger Dingledine published it in 2010 at the ACM (Association for Computing Machinery) Conference on Computer and Communications Security (CCS). TUF splits the update information among roles with separate keys, can require several keys to sign a role’s file, gives each signed metadata file an expiry time, and has the client reject metadata older than what it has already seen.
Basis of this account
This account rests on the paper: Justin Samuel, Nick Mathewson, Justin Cappos and Roger Dingledine, “Survivable Key Compromise in Software Update Systems”, Proceedings of CCS 2010, Chicago, 4 to 8 October 2010, read in the PDF that the TUF project hosts (https://theupdateframework.io/papers/survivable-key-compromise-ccs2010.pdf). Sections 1 to 3 and 6 to 8 were read in full, and Sections 4, 5, 9 and 10 in part. The comparison with version 1.0.37 uses Sections 5.3 to 5.7 of the TUF project specification (https://theupdateframework.github.io/specification/latest/). Nothing was run for this account.
What the paper claims
The authors make these claims.
Three kinds of information need protection. An update system must authenticate the content of updates, their timeliness (whether newer updates exist) and the consistency of the repository, meaning which files were published together. Each kind, if unprotected, enables one attack: installation of malicious software; a freeze attack, which keeps the client from learning that updates exist; and a metadata inconsistency attack, which makes the client use a combination of files that never existed together on the repository.
Existing systems survive key compromise poorly. After examining popular package managers, library managers and application updaters, they found the systems’ ability to protect this information after a key compromise to be “weak or nonexistent”, and their means of revoking trust inadequate. They single out reliance on a public key infrastructure (PKI) built on third-party certificate authorities as especially risky, because the software provider does not control that chain of trust.
Design principles. Separate responsibilities into roles with different keys; require several signatures (multi-signature trust); support explicit revocation, a signed statement that a key is no longer trusted, and implicit revocation, trust that ends by itself, for example at an expiry date; and keep the keys whose theft would do the most harm on machines that are offline, or at least not reachable from the public network.
Survivability results. In their analysis of TUF, theft of fewer root keys §5.25 than the threshold puts no client at risk. Theft of the targets keys alone is no immediate threat, because installing malicious software also needs the release and timestamp keys. Theft of the timestamp key alone permits freeze attacks, whose length is bounded by the expiry times of the metadata. Theft of enough root keys to meet the threshold lets an attacker who can answer client requests compromise every client.
Practicality. They integrated prototypes with the application updater of Seattle, a platform for running untrusted code on end-user machines, and with PyPI (the Python §12.23 Package Index) and its installer
easy_install.
How it works
TUF grew out of Thandy, the updater that the Tor Project built for its anonymity §5.45 software. The paper uses these terms. Target files are the files a client finally wants, such as software packages. Metadata files are signed files that describe roles, other metadata files and target files. A repository is the logical source of both; mirrors are the actual servers that hold copies of it, and they need not be trusted. A role is a responsibility with its own set of keys and its own threshold: the number of distinct keys of that role whose signatures a file must carry.
The paper’s design has four top-level roles, each with one metadata file.
Root signs
root.txt, which lists, for every top-level role including root itself, the identifiers of the trusted keys and the threshold. Root keys are meant to be the best protected and the least used.Targets signs
targets.txt, which gives for each target file its path, its length in bytes and its cryptographic hashes §5.1. It may delegate a set of paths to another role, which then signs its own targets file.Release signs
release.txt, which records the hashes and lengths of the root and targets metadata, including files for delegated targets roles. A client that checks it uses one consistent state of the repository.Timestamp signs
timestamp.txt, which names the latestrelease.txt. The file is re-signed often and expires soon, so its key usually sits on an online server, where theft is most likely; for that reason the role has only this one narrow job.
Each metadata file consists of signed content, encoded as canonical JSON §12.28 (JavaScript Object Notation) so that signer and verifier sign and check the same bytes, and a list of signatures, each with the identifier of the signing key. The signed content carries a creation time and an expiry time. A client accepts a metadata file only if all of these hold:
it carries valid signatures from at least the threshold number of the keys that
root.txtlists for its role;its creation time is valid and its expiry time lies in the future;
it is not older than the copy of the same file that the client saw last;
for every file except
timestamp.txt, its hashes and length match the values announced by the file above it, so the client can bound those downloads using authenticated lengths.
A client checks for updates in this order.
Download and verify
timestamp.txt.If it names a new
release.txt, download and verify that file.Find which metadata files listed in
release.txthave changed since the last release file the client saw. Ifroot.txtchanged, start again with the new root file.Download and verify the changed targets metadata, and offer the available target files to the update system.
Download a chosen target file and check its length and hashes against the targets metadata.
Hand the file to the update system, which installs it; TUF itself only retrieves and verifies.
Key revocation §5.32 works through the role above. To remove a stolen key of a top-level role, the root role signs a new root.txt without that key. A delegating role removes its delegates the same way, and revoking a role also revokes every delegation that role made. Expiry times provide implicit revocation: a file that is not re-signed stops being accepted.
Worked example
The vendor, versions, dates and lifetimes in this example are invented. A vendor runs a TUF repository with this configuration: root, threshold 2 of 3 keys, files valid for 365 days; targets, threshold 1, valid for 30 days; release, threshold 1, valid for 7 days; timestamp, threshold 1, re-signed every day and valid for 1 day. On day 3 the vendor publishes release version 41, which lists app 1.2 and is valid until day . A client downloads it. On day 5 the vendor fixes a vulnerability and publishes release version 42, which lists app 1.3.
Signature check only. Suppose instead that the client checked only one signature on each package. An attacker who controls the network, or runs a mirror, serves app 1.2, which has the known vulnerability and carries a genuine signature. The signature verifies and the client installs the vulnerable version. Nothing in the check tells the client that app 1.3 exists, and no expiry makes the old signature stale.
Under TUF, attacker without keys. The attacker can replay the timestamp file signed on day 4, which still names release version 41, but that file expires on day . The attacker can hide the fix for about one day at most; after that the client rejects the replayed file and knows that something is wrong. The attacker also cannot show release version 41 to a client that has already seen version 42, because the client rejects metadata older than what it has seen.
Under TUF, timestamp key stolen. Now the attacker also holds the online timestamp key and signs a fresh timestamp file every day that still names release version 41. The client accepts these files. But release version 41 itself expires on day 10, and the attacker cannot re-sign it without the release key. The client is frozen from day 5 to day 10, which is days at most, and then detects the problem. To make the client install malicious software, the attacker would also need the release and targets keys.
One root key stolen. The attacker cannot sign a new root.txt, which needs 2 of the 3 root keys. The vendor uses the 2 remaining keys to sign a new root.txt that replaces the stolen key, and clients pick it up on their next check.
What this account does not establish
The 2010 paper calls the role release. Version 1.0.37 of the specification calls it snapshot and uses version numbers to detect rollback. The updater starts with trusted root metadata. When it requests newer root or timestamp metadata, it enforces a byte limit chosen by the application. An authenticated length may also be absent for snapshot or targets metadata, in which case the updater uses an application limit for the download.
The survivability results are the authors’ analysis of the design, not measurements of attacks.
TUF authenticates what the repository’s keys approved; it does not make that software safe. The paper assumes that the project’s internal processes for managing its code are secure, so a faulty update that passes through them is accepted like any other.
Detecting that a key was stolen is outside the paper’s scope. A key is removed only after its theft is noticed.
A client cannot stop an attacker who blocks all traffic. TUF lets it notice replayed or stale answers; it does not let it obtain updates.
Expiry checks need a correct clock on the client. An attacker who can set the client’s clock back makes expired files look valid.
The paper’s thresholds use a plain list of ordinary signatures, not a threshold signature scheme §5.14 in the cryptographic sense, so a file’s signatures grow with the number of signers.
Choosing thresholds and lifetimes needs judgment; the authors state that the risk attached to a key cannot be clearly quantified.
Questions answered
Why is signature verification alone insufficient?
Signature verification alone is insufficient because a valid digital signature proves only that the holder of one particular private key signed these exact bytes at some time. It does not prove that the file is the newest, that it belongs with the other files the client is using, that the key is still trusted for this kind of file, or that the key has not been stolen. Without ever breaking the signature algorithm §14.1, an attacker can:
replay an old, genuinely signed version that has a known vulnerability (a rollback attack);
keep showing a client old, genuinely signed metadata so that the client never learns of a fix (a freeze attack);
combine genuinely signed files that were never published together (a metadata inconsistency, or mix-and-match, attack);
send a genuinely signed file that is meant for another product or was signed by a key that is not trusted for this purpose;
send an endless stream of data before any signature can be checked;
steal the only signing key, after which every forgery verifies.
TUF, The Update Framework (Samuel and others, 2010), adds the missing checks: a root file that states which keys may sign for which role, with thresholds and revocation; expiry times on all metadata; refusal of metadata older than what the client has seen; a release file that fixes one consistent state of the repository; a timestamp file that announces the newest release; and expected hashes and lengths for downloads after the timestamp file. The timestamp file itself is the starting point for those checks. It also spreads the signing duties over separate keys, so that stealing one of them does limited damage.
Related entries: Digital signature (§5.14), Rollback versus anti-rollback (§8.26), Uptane: distributing update verification across vehicle roles (§21.11), Replay attack (§1.26), Key revocation (§5.32), Key rotation (§5.29), Root of trust (§1.33), Canonical JSON (§12.28), Version high-water mark (§8.27). Further reading: [211, 212, 213].