Skip to content

Commit c51875f

Browse files
authored
Add more text describing threshold computation (#154)
* Add signature threshold computation advice Several implementations have made similar errors -- counting multiple signatures by the same keyid -- when implementing signature threshold computation, for example the reference implementation: GHSA-pwqf-9h7j-7mv8 theupdateframework/python-tuf@83ac7be Add some extra description to the detailed client workflow to further explain that a threshold of signatures should only count one signature per key. Signed-off-by: Joshua Lock <[email protected]> * Recommend signatures only contain one sig per keyid In an attempt to help implementers protect against incorrect threshold computation, update "File formats" to suggest that the signatures list contain only a single signature per keyid at metadata creation time. Suggested-by: Jussi Kukkonen <[email protected]> Signed-off-by: Joshua Lock <[email protected]> * Address review comments Be more explicit that each KEYID can only count one signature towards the threshold. Signed-off-by: Joshua Lock <[email protected]> * Bump version and date Signed-off-by: Joshua Lock <[email protected]> --------- Signed-off-by: Joshua Lock <[email protected]> Signed-off-by: Joshua Lock <[email protected]>
1 parent 231cb11 commit c51875f

File tree

1 file changed

+47
-18
lines changed

1 file changed

+47
-18
lines changed

tuf-spec.md

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Title: The Update Framework Specification
33
Shortname: TUF
44
Status: LS
55
Abstract: A framework for securing software update systems.
6-
Date: 2023-03-02
6+
Date: 2023-04-14
77
Editor: Justin Cappos, NYU
88
Editor: Trishank Karthik Kuppusamy, Datadog
99
Editor: Joshua Lock, Verizon
@@ -16,7 +16,7 @@ Boilerplate: copyright no, conformance no
1616
Local Boilerplate: header yes
1717
Markup Shorthands: css no, markdown yes
1818
Metadata Include: This version off, Abstract off
19-
Text Macro: VERSION 1.0.32
19+
Text Macro: VERSION 1.0.33
2020
</pre>
2121

2222
Note: We strive to make the specification easy to implement, so if you come
@@ -547,6 +547,12 @@ All signed metadata objects have the format:
547547
::
548548
A hex-encoded signature of the canonical form of the metadata for <a for="role">ROLE</a>.
549549

550+
Note: The "signatures" list SHOULD only contain one <a>SIGNATURE</a> per
551+
<a for="role">KEYID</a>. This helps prevent multiple signatures by the same key
552+
being counted erroneously towards the minimum <a>THRESHOLD</a> indicating valid
553+
metadata. <a>THRESHOLD</a> counting is further described in the relevant steps
554+
of [[#detailed-client-workflow]].
555+
550556
### Key objects ### {#file-formats-keys}
551557

552558
All <dfn>KEY</dfn> objects have the format:
@@ -1322,11 +1328,18 @@ it in the next step.
13221328
example, Y may be 2^10.
13231329

13241330
4. **Check for an arbitrary software attack.** Version N+1 of the root
1325-
metadata file MUST have been signed by: (1) a threshold of keys specified in
1326-
the trusted root metadata file (version N), and (2) a threshold of keys
1327-
specified in the new root metadata file being validated (version N+1). If
1328-
version N+1 is not signed as required, discard it, abort the update cycle,
1329-
and report the signature failure.
1331+
metadata file MUST have been signed by: (1) a <a>THRESHOLD</a> of keys
1332+
specified in the trusted root metadata file (version N), and (2) a
1333+
<a>THRESHOLD</a> of keys specified in the new root metadata file being
1334+
validated (version N+1). When computing the <a>THRESHOLD</a> each
1335+
<a>KEY</a> MUST only contribute one <a>SIGNATURE</a>. That is, each
1336+
<a>SIGNATURE</a> which is counted towards the <a>THRESHOLD</a> MUST have
1337+
a unique <a>KEYID</a>. Even if a <a>KEYID</a> is listed more than once in the
1338+
"signatures" list a client MUST NOT count more than one verified
1339+
<a>SIGNATURE</a> from that <a>KEYID</a> towards the <a>THRESHOLD</a>.
1340+
If version N+1 is not signed as required, discard it, abort the update cycle,
1341+
and report the signature failure. On the next update cycle, begin at step
1342+
[[#update-root]] and version N of the root metadata file.
13301343

13311344
5. **Check for a rollback attack.** The version number of the new root
13321345
metadata (version N+1) MUST be exactly the version in the trusted root
@@ -1372,10 +1385,15 @@ it in the next step.
13721385
(e.g., timestamp.json).
13731386

13741387
2. **Check for an arbitrary software attack.** The new timestamp
1375-
metadata file MUST have been signed by a threshold of keys specified in the
1376-
trusted root metadata file. If the new timestamp metadata file is not
1377-
properly signed, discard it, abort the update cycle, and report the signature
1378-
failure.
1388+
metadata file MUST have been signed by a <a>THRESHOLD</a> of keys specified
1389+
in the trusted root metadata file. When computing the <a>THRESHOLD</a> each
1390+
<a>KEY</a> MUST only contribute one <a>SIGNATURE</a>. That is, each
1391+
<a>SIGNATURE</a> which is counted towards the <a>THRESHOLD</a> MUST have
1392+
a unique <a>KEYID</a>. Even if a <a>KEYID</a> is listed more than once in the
1393+
"signatures" list a client MUST NOT count more than one verified
1394+
<a>SIGNATURE</a> from that <a>KEYID</a> towards the <a>THRESHOLD</a>. If the
1395+
new timestamp metadata file is not properly signed, discard it, abort the
1396+
update cycle, and report the signature failure.
13791397

13801398
3. **Check for a rollback attack.**
13811399

@@ -1426,10 +1444,15 @@ it in the next step.
14261444
new snapshot metadata, abort the update cycle, and report the failure.
14271445

14281446
3. **Check for an arbitrary software attack**. The new snapshot
1429-
metadata file MUST have been signed by a threshold of keys specified in the
1430-
trusted root metadata file. If the new snapshot metadata file is not signed
1431-
as required, discard it, abort the update cycle, and report the signature
1432-
failure.
1447+
metadata file MUST have been signed by a <a>THRESHOLD</a> of keys specified in
1448+
the trusted root metadata file. When computing the <a>THRESHOLD</a> each
1449+
<a>KEY</a> MUST only contribute one <a>SIGNATURE</a>. That is, each
1450+
<a>SIGNATURE</a> which is counted towards the <a>THRESHOLD</a> MUST have
1451+
a unique <a>KEYID</a>. Even if a <a>KEYID</a> is listed more than once in the
1452+
"signatures" list a client MUST NOT count more than one verified
1453+
<a>SIGNATURE</a> from that <a>KEYID</a> towards the <a>THRESHOLD</a>. If the
1454+
new snapshot metadata file is not signed as required, discard it, abort the
1455+
update cycle, and report the signature failure.
14331456

14341457
4. **Check against timestamp role's snapshot version**. The version
14351458
number of the new snapshot metadata file MUST match the version number listed
@@ -1477,9 +1500,15 @@ it in the next step.
14771500
target metadata, abort the update cycle, and report the failure.
14781501

14791502
3. **Check for an arbitrary software attack**. The new targets
1480-
metadata file MUST have been signed by a threshold of keys specified in the
1481-
trusted root metadata file. If the new targets metadata file is not signed
1482-
as required, discard it, abort the update cycle, and report the failure.
1503+
metadata file MUST have been signed by a <a>THRESHOLD</a> of keys specified
1504+
in the trusted root metadata file. When computing the <a>THRESHOLD</a> each
1505+
<a>KEY</a> MUST only contribute one <a>SIGNATURE</a>. That is, each
1506+
<a>SIGNATURE</a> which is counted towards the <a>THRESHOLD</a> MUST have a
1507+
unique <a>KEYID</a>. Even if a <a>KEYID</a> is listed more than once in the
1508+
"signatures" list a client MUST NOT count more than one verified
1509+
<a>SIGNATURE</a> from that <a>KEYID</a> towards the <a>THRESHOLD</a>. If the
1510+
new targets metadata file is not signed as required, discard it, abort the
1511+
update cycle, and report the failure.
14831512

14841513
4. **Check against snapshot role's targets version**. The version
14851514
number of the new targets metadata file MUST match the version number listed

0 commit comments

Comments
 (0)