Skip to content

Commit d086549

Browse files
lukpuehmnm678
authored andcommitted
Clarify recovery from ffwd on delegated targets
Akin to the recovery from fast-forward attacks on the top-level targets role, if a delegated targets role has been compromised, the previously trusted delegated targets metadata and the previously trusted snapshot metadata must be deleted. This must happen so that the rollback attack check (*), which makes sure that the version number of the new delegated targets is higher (or equal) than that of the old does not prevent updates after an ffwd attack. For the top-level targets metadata ffwd recovery logic is performed based on key removals in the root metadata and thus can happen before downloading the snapshot metadata. For delegated targets, on the other hand, where the keys are defined by delegating targets role(s) and not in the root metadata, ffwd recovery logic can only be performed after the delegating targets have been downloaded. (*) Note that there are two targets role rollback checks. One is based on the snapshot metadata, to fail early, i.e. before a potentially compromised (delegated) targets metadata is downloaded, and the other is based directly on the (delegated) targets metadata, so that an attacker needs to compromise snapshot and (delegated) targets keys, to successfully perform a rollback attack. This commit updates the client workflow according to above observations.
1 parent 5f62112 commit d086549

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

tuf-spec.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,6 @@ it in the next step.
14261426
file. If the new snapshot metadata file is expired, discard it, abort the
14271427
update cycle, and report the potential freeze attack.
14281428

1429-
14301429
7. **Persist snapshot metadata**. The client MUST write the file to
14311430
non-volatile storage as FILENAME.EXT (e.g. snapshot.json).
14321431

@@ -1485,7 +1484,18 @@ it in the next step.
14851484
1. Let DELEGATE denote the current target role TARGETS is
14861485
delegating to.
14871486

1488-
2. **Download the DELEGATE targets metadata file**, up to either
1487+
2. **Fast-forward attack recovery.** If a threshold of
1488+
delegated targets keys for the current delegation are removed from the
1489+
TARGETS metadata, delete the trusted DELEGATE metadata, if any, and the
1490+
previously trusted snapshot metadata.
1491+
1492+
3. **Check for a rollback attack via snapshot.** The version number of the
1493+
DELEGATE metadata in the previous trusted snapshot metadata, if any, MUST
1494+
be less than or equal to its version number in the new trusted snapshot
1495+
metadata. If this is not the case, abort the update cycle, and report the
1496+
potential rollback attack.
1497+
1498+
4. **Download the DELEGATE targets metadata file**, up to either
14891499
the number of bytes specified in the snapshot metadata file, or some Z
14901500
number of bytes. The value for Z is set by the authors of the application
14911501
using TUF. For example, Z may be tens of kilobytes. IF DELEGATE cannot be
@@ -1498,39 +1508,40 @@ it in the next step.
14981508
in the snapshot metadata file. In either case, the client MUST write the
14991509
file to non-volatile storage as FILENAME.EXT.
15001510

1501-
3. **Check against snapshot metadata.** The hashes (if any), and
1511+
5. **Check against snapshot metadata.** The hashes (if any), and
15021512
version number of the new DELEGATE metadata file MUST match the trusted
1503-
snapshot metadata. This is done, in part, to prevent a mix-and-match
1513+
snapshot metadata, if any. This is done, in part, to prevent a mix-and-match
15041514
attack by man-in-the-middle attackers. If the new DELEGATE metadata file
15051515
does not match, abort the update cycle, and report the failure.
15061516

1507-
4. **Check for an arbitrary software attack.** The new DELEGATE
1517+
6. **Check for an arbitrary software attack.** The new DELEGATE
15081518
metadata file MUST have been signed by a threshold of keys specified in the
15091519
TARGETS metadata file. If the new DELEGATE metadata file is not signed
15101520
as required, abort the update cycle, and report the failure.
15111521

1512-
5. **Check for a rollback attack.** The version number of the
1513-
trusted DELEGATE metadata file, if any, MUST be less than or equal to the
1514-
version number of the new DELEGATE metadata file. If the new DELEGATE
1515-
metadata file is older than the trusted DELEGATE metadata file, discard
1516-
it, abort the update cycle, and report the potential rollback attack.
1522+
7. **Check for a rollback attack on the DELEGATE metadata.**
1523+
The version number of the trusted DELEGATE metadata file, if any, MUST be
1524+
less than or equal to the version number of the new DELEGATE metadata
1525+
file. If the new DELEGATE metadata file is older than the trusted
1526+
DELEGATE metadata file abort the update cycle, and report the potential
1527+
rollback attack.
15171528

1518-
6. **Check for a freeze attack.** The latest known time
1529+
8. **Check for a freeze attack.** The latest known time
15191530
should be lower than the expiration timestamp in the new DELEGATE
15201531
metadata file. If so, the new DELEGATE file becomes the trusted DELEGATE
15211532
file. If the new DELEGATE metadata file is expired, abort the update
15221533
cycle, and report the potential freeze attack.
15231534

1524-
7. If the current delegation is a multi-role delegation,
1535+
9. If the current delegation is a multi-role delegation,
15251536
recursively visit each role, and check that each has signed exactly the
15261537
same non-custom metadata (i.e., length and hashes) about the target (or
15271538
the lack of any such metadata). Otherwise, abort the update cycle, and
15281539
report the failure.
15291540

1530-
7. If the current delegation is a terminating delegation,
1541+
10. If the current delegation is a terminating delegation,
15311542
then jump to step [[#fetch-target]].
15321543

1533-
9. Otherwise, if the current delegation is a non-terminating
1544+
11. Otherwise, if the current delegation is a non-terminating
15341545
delegation, continue processing the next delegation, if any, by repeating
15351546
the preorder depth-first search with DELEGATE as the current TARGET role.
15361547
Stop the search, and jump to step [[#fetch-target]]. as soon as a

0 commit comments

Comments
 (0)