Skip to content

Commit 2c5e4f3

Browse files
ericktmnm678
authored andcommitted
Clarify how delegated roles are downloaded
Section 7 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 7 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 d3ee698 commit 2c5e4f3

File tree

1 file changed

+48
-12
lines changed

1 file changed

+48
-12
lines changed

tuf-spec.md

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,10 +1455,9 @@ it in the next step.
14551455
6. **Persist targets metadata**. The client MUST write the file to
14561456
non-volatile storage as FILENAME.EXT (e.g. targets.json).
14571457

1458-
7. **Perform a pre-order depth-first search for metadata about the
1459-
desired target, beginning with the top-level targets role.** Note: If
1460-
any metadata requested in steps 5.6.7.1 - 5.6.7.2 cannot be downloaded nor
1461-
validated, end the search and report that the target cannot be found.
1458+
7. **Perform a preorder depth-first search for metadata about the
1459+
desired target.** Let TARGETS be the current metadata, beginning with the
1460+
top-level targets metadata role.
14621461

14631462
1. If this role has been visited before, then skip this role
14641463
(so that cycles in the delegation graph are avoided). Otherwise, if an
@@ -1470,18 +1469,55 @@ it in the next step.
14701469
2. Otherwise, recursively search the list of delegations in
14711470
order of appearance.
14721471

1473-
1. If the current delegation is a multi-role delegation,
1472+
1. Let DELEGATE denote the current target role TARGETS is
1473+
delegating to.
1474+
1475+
2. **Download the DELEGATE tarets metadata file**, up to either
1476+
the number of bytes specified in the snapshot metadata file, or some Z
1477+
number of bytes. The value for Z is set by the authors of the application
1478+
using TUF. For example, Z may be tens of kilobytes. IF DELEGATE cannot be
1479+
found, end the search and report the target cannot be found. If
1480+
consistent snapshots are not used (see Section 7), then the filename used
1481+
to download the targets metadata file is of the fixed form FILENAME.EXT
1482+
(e.g., delegated_rol.json). Otherwise, the filename is of the form
1483+
VERSION_NUMBER.FILENAME.EXT (e.g., 42.delegated_role.json), where
1484+
VERSION_NUMBER is the version number of the DELEGATE metadata file listed
1485+
in the snapshot metadata file. In either case, the client MUST write the
1486+
file to non-volatile storage as FILENAME.EXT.
1487+
1488+
3. **Check against snapshot metadata.** The hashes (if any), and
1489+
version number of the new DELEGATE metadata file MUST match the trusted
1490+
snapshot metadata. This is done, in part, to prevent a mix-and-match
1491+
attack by man-in-the-middle attackers. If the new DELEGATE metadata file
1492+
does not match, discard it, end the search, and report the target cannot
1493+
be found.
1494+
1495+
4. **Check for an arbitrary software attack.** The new DELEGATE
1496+
metadata file MUST have been signed by a threshold of keys specified in the
1497+
TARGETS metadata file. If the new DELEGATE metadata file is not signed
1498+
as required, discard it, end the search, and report the target cannot be
1499+
found.
1500+
1501+
5. **Check for a rollback attack.** The version number of the
1502+
trusted DELEGATE metadata file, if any, MUST be less than or equal to the
1503+
version number of the new DELEGATE metadata file. If the new DELEGATE
1504+
metadata file is older than the trusted DELEGATE metadata file, discard
1505+
it, end the search, and report the target cannot be found.
1506+
1507+
6. If the current delegation is a multi-role delegation,
14741508
recursively visit each role, and check that each has signed exactly the
14751509
same non-custom metadata (i.e., length and hashes) about the target (or
1476-
the lack of any such metadata).
1510+
the lack of any such metadata). Otherwise, discard it, end the search,
1511+
and report the target cannot be found.
14771512

1478-
2. If the current delegation is a terminating delegation,
1479-
then jump to step [[#fetch-target]].
1513+
7. If the current delegation is a terminating delegation,
1514+
then jump to step [[#fetch-target]]..
14801515

1481-
3. Otherwise, if the current delegation is a
1482-
non-terminating delegation, continue processing the next delegation, if
1483-
any. Stop the search, and jump to step [[#fetch-target]] as soon as a delegation
1484-
returns a result.
1516+
8. Otherwise, if the current delegation is a non-terminating
1517+
delegation, continue processing the next delegation, if any, by repeating
1518+
the preorder depth-first search with DELEGATE as the current TARGET role.
1519+
Stop the search, and jump to step [[#fetch-target]]. as soon as a
1520+
delegation returns a result.
14851521

14861522
## Fetch target ## {#fetch-target}
14871523

0 commit comments

Comments
 (0)