Skip to content

Commit 75ac163

Browse files
ericktlukpueh
authored andcommitted
Clarify how delegated roles are downloaded
Section 5.4.5 is a little vague how on delegated targets are fetched and validated. This updates that section to use the same logic and verification process as downloading the top-level targets role to be explicit. One thing to point out though is that the old section 4.5 suggests that we don't report verification errors to the user. I've preserved this in my explicit version. I imagine users would still be notified if their delegated roles may be undergoing an attack. Is this intentional, or should I switch to the "abort the update cycle, and report the potential rollback attack"-style phrasing used elsewhere in the spec?
1 parent 0ecf980 commit 75ac163

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

tuf-spec.md

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,9 +1258,8 @@ non-volatile storage as FILENAME.EXT.
12581258
and report the potential freeze attack.
12591259

12601260
* **4.5**. **Perform a preorder depth-first search for metadata about the
1261-
desired target, beginning with the top-level targets role.** Note: If
1262-
any metadata requested in steps 4.5.1 - 4.5.2.3 cannot be downloaded nor
1263-
validated, end the search and report that the target cannot be found.
1261+
desired target.** Let TARGETS be the current metadata, beginning with the
1262+
top-level targets metadata role.
12641263

12651264
* **4.5.1**. If this role has been visited before, then skip this role (so
12661265
that cycles in the delegation graph are avoided). Otherwise, if an
@@ -1272,17 +1271,54 @@ non-volatile storage as FILENAME.EXT.
12721271
* **4.5.2**. Otherwise, recursively search the list of delegations in order
12731272
of appearance.
12741273

1275-
* **4.5.2.1**. If the current delegation is a multi-role delegation,
1274+
* **4.5.2.1**. Let DELEGATE denote the current target role TARGETS is
1275+
delegating to.
1276+
1277+
* **4.5.2.2**. **Download the DELEGATE tarets metadata file**, up to either
1278+
the number of bytes specified in the snapshot metadata file, or some Z
1279+
number of bytes. The value for Z is set by the authors of the application
1280+
using TUF. For example, Z may be tens of kilobytes. IF DELEGATE cannot be
1281+
found, end the search and report the target cannot be found. If
1282+
consistent snapshots are not used (see Section 7), then the filename used
1283+
to download the targets metadata file is of the fixed form FILENAME.EXT
1284+
(e.g., delegated_rol.json). Otherwise, the filename is of the form
1285+
VERSION_NUMBER.FILENAME.EXT (e.g., 42.delegated_role.json), where
1286+
VERSION_NUMBER is the version number of the DELEGATE metadata file listed
1287+
in the snapshot metadata file. In either case, the client MUST write the
1288+
file to non-volatile storage as FILENAME.EXT.
1289+
1290+
* **4.5.2.3**. **Check against snapshot metadata.** The hashes (if any), and
1291+
version number of the new DELEGATE metadata file MUST match the trusted
1292+
snapshot metadata. This is done, in part, to prevent a mix-and-match
1293+
attack by man-in-the-middle attackers. If the new DELEGATE metadata file
1294+
does not match, discard it, end the search, and report the target cannot
1295+
be found.
1296+
1297+
* **4.5.2.4**. **Check for an arbitrary software attack.** The new DELEGATE
1298+
metadata file MUST have been signed by a threshold of keys specified in the
1299+
TARGETS metadata file. If the new DELEGATE metadata file is not signed
1300+
as required, discard it, end the search, and report the target cannot be
1301+
found.
1302+
1303+
* **4.5.2.5**. **Check for a rollback attack.** The version number of the
1304+
trusted DELEGATE metadata file, if any, MUST be less than or equal to the
1305+
version number of the new DELEGATE metadata file. If the new DELEGATE
1306+
`metadata file is older than the trusted DELEGATE metadata file, discard
1307+
it, end the search, and report the target cannot be found.
1308+
1309+
* **4.5.2.6**. If the current delegation is a multi-role delegation,
12761310
recursively visit each role, and check that each has signed exactly the
12771311
same non-custom metadata (i.e., length and hashes) about the target (or
1278-
the lack of any such metadata).
1312+
the lack of any such metadata). Otherwise, discard it, end the search,
1313+
and report the target cannot be found.
12791314

1280-
* **4.5.2.2**. If the current delegation is a terminating delegation,
1315+
* **4.5.2.7**. If the current delegation is a terminating delegation,
12811316
then jump to step 5.
12821317

1283-
* **4.5.2.3**. Otherwise, if the current delegation is a non-terminating
1284-
delegation, continue processing the next delegation, if any. Stop the
1285-
search, and jump to step 5 as soon as a delegation returns a result.
1318+
* **4.5.2.8**. Otherwise, if the current delegation is a non-terminating
1319+
delegation, continue processing the next delegation, if any, by repeating
1320+
step 4.5 with DELEGATE as the current TARGET role. Stop the search, and
1321+
jump to step 5 as soon as a delegation returns a result.
12861322

12871323
**5**. **Verify the desired target against its targets metadata**.
12881324

0 commit comments

Comments
 (0)