@@ -1073,41 +1073,42 @@ repo](https://github.com/theupdateframework/specification/issues).
1073
1073
still be able to update again in the future. Errors raised during the update
1074
1074
process should not leave clients in an unrecoverable state.
1075
1075
1076
- ** 0** . ** Load the trusted root metadata file.** We assume that a good, trusted
1077
- copy of this file was shipped with the package manager or software updater
1078
- using an out-of-band process. Note that the expiration of the trusted root
1079
- metadata file does not matter, because we will attempt to update it in the
1080
- next step.
1081
-
1082
- ** 1** . ** Update the root metadata file.**
1083
- Since it may now be signed using entirely different keys, the client MUST
1084
- somehow be able to establish a trusted line of continuity to the latest set
1085
- of keys (see Section 6.1). To do so, the client MUST download intermediate
1086
- root metadata files, until the latest available one is reached. Therefore, it
1087
- MUST temporarily turn on consistent snapshots in order to download
1088
- _ versioned_ root metadata files as described next.
1089
-
1090
- * ** 1.1** . Let N denote the version number of the trusted root metadata file.
1091
-
1092
- * ** 1.2** . ** Try downloading version N+1 of the root metadata file** , up to
1076
+ ** 5.0** . ** Load the trusted root metadata file.** We assume that a good,
1077
+ trusted copy of this file was shipped with the package manager or software
1078
+ updater using an out-of-band process. Note that the expiration of the
1079
+ trusted root metadata file does not matter, because we will attempt to update
1080
+ it in the next step.
1081
+
1082
+ ** 5.1** . ** Update the root metadata file.** Since it may now be signed using
1083
+ entirely different keys, the client MUST somehow be able to establish a
1084
+ trusted line of continuity to the latest set of keys (see Section 6.1). To do
1085
+ so, the client MUST download intermediate root metadata files, until the
1086
+ latest available one is reached. Therefore, it MUST temporarily turn on
1087
+ consistent snapshots in order to download _ versioned_ root metadata files as
1088
+ described next.
1089
+
1090
+ * ** 5.1.1** . Let N denote the version number of the trusted root metadata
1091
+ file.
1092
+
1093
+ * ** 5.1.2** . ** Try downloading version N+1 of the root metadata file** , up to
1093
1094
some W number of bytes (because the size is unknown). The value for W is set
1094
1095
by the authors of the application using TUF. For example, W may be tens of
1095
1096
kilobytes. The filename used to download the root metadata file is of the
1096
1097
fixed form VERSION_NUMBER.FILENAME.EXT (e.g., 42.root.json). If this file is
1097
- not available, or we have downloaded more than Y number of root metadata files
1098
- (because the exact number is as yet unknown), then go to step 1.8. The value
1099
- for Y is set by the authors of the application using TUF. For example, Y may
1100
- be 2^10.
1098
+ not available, or we have downloaded more than Y number of root metadata
1099
+ files (because the exact number is as yet unknown), then go to step 1.8. The
1100
+ value for Y is set by the authors of the application using TUF. For example,
1101
+ Y may be 2^10.
1101
1102
1102
- * ** 1.3. Check for an arbitrary software attack.** Version N+1 of the root
1103
+ * ** 5. 1.3. Check for an arbitrary software attack.** Version N+1 of the root
1103
1104
metadata file MUST have been signed by: (1) a threshold of keys specified in
1104
1105
the trusted root metadata file (version N), and (2) a threshold of keys
1105
1106
specified in the new root metadata file being validated (version N+1). If
1106
1107
version N+1 is not signed as required, discard it, abort the update cycle,
1107
1108
and report the signature failure. On the next update cycle, begin at step 0
1108
1109
and version N of the root metadata file.
1109
1110
1110
- * ** 1.4. Check for a rollback attack.** The version number of the trusted
1111
+ * ** 5. 1.4. Check for a rollback attack.** The version number of the trusted
1111
1112
root metadata file (version N) MUST be less than or equal to the version
1112
1113
number of the new root metadata file (version N+1). Effectively, this means
1113
1114
checking that the version number signed in the new root metadata file is
@@ -1116,71 +1117,71 @@ repo](https://github.com/theupdateframework/specification/issues).
1116
1117
rollback attack. On the next update cycle, begin at step 0 and version N of
1117
1118
the root metadata file.
1118
1119
1119
- * ** 1.5** . Note that the expiration of the new (intermediate) root metadata
1120
- file does not matter yet, because we will check for it in step 1.8.
1120
+ * ** 5. 1.5** . Note that the expiration of the new (intermediate) root metadata
1121
+ file does not matter yet, because we will check for it in step 5. 1.8.
1121
1122
1122
- * ** 1.6** . ** Set the trusted root metadata file** to the new root metadata
1123
+ * ** 5. 1.6** . ** Set the trusted root metadata file** to the new root metadata
1123
1124
file.
1124
1125
1125
- * ** 1.7** . ** Persist root metadata.** The client MUST write the file to
1126
+ * ** 5. 1.7** . ** Persist root metadata.** The client MUST write the file to
1126
1127
non-volatile storage as FILENAME.EXT (e.g. root.json).
1127
1128
1128
- * ** 1.8** . ** Repeat steps 1.1 to 1.8** .
1129
+ * ** 5. 1.8** . ** Repeat steps 5. 1.1 to 5. 1.8** .
1129
1130
1130
- * ** 1.9** . ** Check for a freeze attack.** The latest known time MUST be
1131
+ * ** 5. 1.9** . ** Check for a freeze attack.** The latest known time MUST be
1131
1132
lower than the expiration timestamp in the trusted root metadata file
1132
1133
(version N). If the trusted root metadata file has expired, abort the update
1133
1134
cycle, report the potential freeze attack. On the next update cycle, begin
1134
1135
at step 0 and version N of the root metadata file.
1135
1136
1136
- * ** 1.10** . ** If the timestamp and / or snapshot keys have been rotated, then
1137
- delete the trusted timestamp and snapshot metadata files.** This is done in
1138
- order to recover from fast-forward attacks after the repository has been
1137
+ * ** 5. 1.10** . ** If the timestamp and / or snapshot keys have been rotated,
1138
+ then delete the trusted timestamp and snapshot metadata files.** This is done
1139
+ in order to recover from fast-forward attacks after the repository has been
1139
1140
compromised and recovered. A _ fast-forward attack_ happens when attackers
1140
1141
arbitrarily increase the version numbers of: (1) the timestamp metadata, (2)
1141
1142
the snapshot metadata, and / or (3) the targets, or a delegated targets,
1142
1143
metadata file in the snapshot metadata. Please see [ the Mercury
1143
1144
paper] ( https://ssl.engineering.nyu.edu/papers/kuppusamy-mercury-usenix-2017.pdf )
1144
1145
for more details.
1145
1146
1146
- * ** 1.11** . ** Set whether consistent snapshots are used as per the trusted
1147
+ * ** 5. 1.11** . ** Set whether consistent snapshots are used as per the trusted
1147
1148
root metadata file** (see Section 4.3).
1148
1149
1149
- ** 2** . ** Download the timestamp metadata file** , up to X number of bytes
1150
+ ** 5. 2** . ** Download the timestamp metadata file** , up to X number of bytes
1150
1151
(because the size is unknown). The value for X is set by the authors of the
1151
1152
application using TUF. For example, X may be tens of kilobytes. The filename
1152
1153
used to download the timestamp metadata file is of the fixed form FILENAME.EXT
1153
1154
(e.g., timestamp.json).
1154
1155
1155
- * ** 2.1** . ** Check for an arbitrary software attack.** The new timestamp
1156
+ * ** 5. 2.1** . ** Check for an arbitrary software attack.** The new timestamp
1156
1157
metadata file MUST have been signed by a threshold of keys specified in the
1157
1158
trusted root metadata file. If the new timestamp metadata file is not
1158
1159
properly signed, discard it, abort the update cycle, and report the signature
1159
1160
failure.
1160
1161
1161
- * ** 2.2** . ** Check for a rollback attack.**
1162
+ * ** 5. 2.2** . ** Check for a rollback attack.**
1162
1163
1163
- * ** 2.2.1** . The version number of the trusted timestamp metadata file, if
1164
+ * ** 5. 2.2.1** . The version number of the trusted timestamp metadata file, if
1164
1165
any, MUST be less than or equal to the version number of the new timestamp
1165
1166
metadata file. If the new timestamp metadata file is older than the
1166
1167
trusted timestamp metadata file, discard it, abort the update cycle, and
1167
1168
report the potential rollback attack.
1168
1169
1169
- * ** 2.2.2** . The version number of the snapshot metadata file in the
1170
+ * ** 5. 2.2.2** . The version number of the snapshot metadata file in the
1170
1171
trusted timestamp metadata file, if any, MUST be less than or equal to its
1171
1172
version number in the new timestamp metadata file. If not, discard the new
1172
1173
timestamp metadata file, abort the update cycle, and report the failure.
1173
1174
1174
- * ** 2.3** . ** Check for a freeze attack.** The latest known time MUST be
1175
+ * ** 5. 2.3** . ** Check for a freeze attack.** The latest known time MUST be
1175
1176
lower than the expiration timestamp in the new timestamp metadata file. If
1176
1177
so, the new timestamp metadata file becomes the trusted timestamp metadata
1177
1178
file. If the new timestamp metadata file has expired, discard it, abort the
1178
1179
update cycle, and report the potential freeze attack.
1179
1180
1180
- * ** 2.4** . ** Persist timestamp metadata.** The client MUST write the file to
1181
- non-volatile storage as FILENAME.EXT (e.g. timestamp.json).
1181
+ * ** 5. 2.4** . ** Persist timestamp metadata.** The client MUST write the file
1182
+ to non-volatile storage as FILENAME.EXT (e.g. timestamp.json).
1182
1183
1183
- ** 3** . ** Download snapshot metadata file** , up to either the number of bytes
1184
+ ** 5. 3** . ** Download snapshot metadata file** , up to either the number of bytes
1184
1185
specified in the timestamp metadata file, or some Y number of bytes. The value
1185
1186
for Y is set by the authors of the application using TUF. For example, Y may be
1186
1187
tens of kilobytes. If consistent snapshots are not used (see
@@ -1190,19 +1191,19 @@ of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.snapshot.json), where
1190
1191
VERSION_NUMBER is the version number of the snapshot metadata file listed in
1191
1192
the timestamp metadata file.
1192
1193
1193
- * ** 3.1** . ** Check against timestamp metadata.** The hashes and version
1194
+ * ** 5. 3.1** . ** Check against timestamp metadata.** The hashes and version
1194
1195
number of the new snapshot metadata file MUST match the hashes, if any, and
1195
1196
version number listed in the trusted timestamp metadata. If hashes and
1196
1197
version do not match, discard the new snapshot metadata, abort the update
1197
1198
cycle, and report the failure.
1198
1199
1199
- * ** 3.2** . ** Check for an arbitrary software attack.** The new snapshot
1200
+ * ** 5. 3.2** . ** Check for an arbitrary software attack.** The new snapshot
1200
1201
metadata file MUST have been signed by a threshold of keys specified in the
1201
1202
trusted root metadata file. If the new snapshot metadata file is not signed
1202
1203
as required, discard it, abort the update cycle, and report the signature
1203
1204
failure.
1204
1205
1205
- * ** 3.3** . ** Check for a rollback attack.** The version number of the targets
1206
+ * ** 5. 3.3** . ** Check for a rollback attack.** The version number of the targets
1206
1207
metadata file, and all delegated targets metadata files, if any, in the
1207
1208
trusted snapshot metadata file, if any, MUST be less than or equal to its
1208
1209
version number in the new snapshot metadata file. Furthermore, any targets
@@ -1211,16 +1212,16 @@ the timestamp metadata file.
1211
1212
these conditions are not met, discard the new snapshot metadata file, abort
1212
1213
the update cycle, and report the failure.
1213
1214
1214
- * ** 3.4** . ** Check for a freeze attack.** The latest known time MUST be
1215
+ * ** 5. 3.4** . ** Check for a freeze attack.** The latest known time MUST be
1215
1216
lower than the expiration timestamp in the new snapshot metadata file. If
1216
1217
so, the new snapshot metadata file becomes the trusted snapshot metadata
1217
1218
file. If the new snapshot metadata file is expired, discard it, abort the
1218
1219
update cycle, and report the potential freeze attack.
1219
1220
1220
- * ** 3.5** . ** Persist snapshot metadata.** The client MUST write the file to
1221
+ * ** 5. 3.5** . ** Persist snapshot metadata.** The client MUST write the file to
1221
1222
non-volatile storage as FILENAME.EXT (e.g. snapshot.json).
1222
1223
1223
- ** 4** . ** Download the top-level targets metadata file** , up to either the
1224
+ ** 5. 4** . ** Download the top-level targets metadata file** , up to either the
1224
1225
number of bytes specified in the snapshot metadata file, or some Z number of
1225
1226
bytes. The value for Z is set by the authors of the application using TUF. For
1226
1227
example, Z may be tens of kilobytes. If consistent snapshots are not used (see
@@ -1230,60 +1231,61 @@ of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.targets.json), where
1230
1231
VERSION_NUMBER is the version number of the targets metadata file listed in the
1231
1232
snapshot metadata file.
1232
1233
1233
- * ** 4.1** . ** Check against snapshot metadata.** The hashes and version
1234
+ * ** 5. 4.1** . ** Check against snapshot metadata.** The hashes and version
1234
1235
number of the new targets metadata file MUST match the hashes, if any, and
1235
1236
version number listed in the trusted snapshot metadata. This is done, in
1236
1237
part, to prevent a mix-and-match attack by man-in-the-middle attackers. If
1237
1238
the new targets metadata file does not match, discard it, abort the update
1238
1239
cycle, and report the failure.
1239
1240
1240
- * ** 4.2** . ** Check for an arbitrary software attack.** The new targets
1241
+ * ** 5. 4.2** . ** Check for an arbitrary software attack.** The new targets
1241
1242
metadata file MUST have been signed by a threshold of keys specified in the
1242
1243
trusted root metadata file. If the new targets metadata file is not signed
1243
1244
as required, discard it, abort the update cycle, and report the failure.
1244
1245
1245
- * ** 4.3** . ** Check for a freeze attack.** The latest known time MUST be
1246
+ * ** 5. 4.3** . ** Check for a freeze attack.** The latest known time MUST be
1246
1247
lower than the expiration timestamp in the new targets metadata file. If so,
1247
1248
the new targets metadata file becomes the trusted targets metadata file. If
1248
1249
the new targets metadata file is expired, discard it, abort the update cycle,
1249
1250
and report the potential freeze attack.
1250
1251
1251
- * ** 4.4** . ** Persist targets metadata.** The client MUST write the file to
1252
+ * ** 5. 4.4** . ** Persist targets metadata.** The client MUST write the file to
1252
1253
non-volatile storage as FILENAME.EXT (e.g. targets.json).
1253
1254
1254
- * ** 4.5** . ** Perform a pre-order depth-first search for metadata about the
1255
+ * ** 5. 4.5** . ** Perform a pre-order depth-first search for metadata about the
1255
1256
desired target, beginning with the top-level targets role.** Note: If
1256
- any metadata requested in steps 4.4.1 - 4.4.2.3 cannot be downloaded nor
1257
+ any metadata requested in steps 5. 4.4.1 - 5. 4.4.2.3 cannot be downloaded nor
1257
1258
validated, end the search and report that the target cannot be found.
1258
1259
1259
- * ** 4.5.1** . If this role has been visited before, then skip this role (so
1260
- that cycles in the delegation graph are avoided). Otherwise, if an
1260
+ * ** 5. 4.5.1** . If this role has been visited before, then skip this role
1261
+ (so that cycles in the delegation graph are avoided). Otherwise, if an
1261
1262
application-specific maximum number of roles have been visited, then go to
1262
1263
step 5 (so that attackers cannot cause the client to waste excessive
1263
1264
bandwidth or time). Otherwise, if this role contains metadata about the
1264
1265
desired target, then go to step 5.
1265
1266
1266
- * ** 4.5.2** . Otherwise, recursively search the list of delegations in order
1267
- of appearance.
1267
+ * ** 5. 4.5.2** . Otherwise, recursively search the list of delegations in
1268
+ order of appearance.
1268
1269
1269
- * ** 4.5.2.1** . If the current delegation is a multi-role delegation,
1270
+ * ** 5. 4.5.2.1** . If the current delegation is a multi-role delegation,
1270
1271
recursively visit each role, and check that each has signed exactly the
1271
1272
same non-custom metadata (i.e., length and hashes) about the target (or
1272
1273
the lack of any such metadata).
1273
1274
1274
- * ** 4.5.2.2** . If the current delegation is a terminating delegation,
1275
+ * ** 5. 4.5.2.2** . If the current delegation is a terminating delegation,
1275
1276
then jump to step 5.
1276
1277
1277
- * ** 4.5.2.3** . Otherwise, if the current delegation is a non-terminating
1278
- delegation, continue processing the next delegation, if any. Stop the
1279
- search, and jump to step 5 as soon as a delegation returns a result.
1278
+ * ** 5.4.5.2.3** . Otherwise, if the current delegation is a
1279
+ non-terminating delegation, continue processing the next delegation, if
1280
+ any. Stop the search, and jump to step 5 as soon as a delegation returns
1281
+ a result.
1280
1282
1281
- ** 5** . ** Verify the desired target against its targets metadata** .
1283
+ ** 5.5 ** . ** Verify the desired target against its targets metadata** .
1282
1284
1283
- * ** 5.1** . If there is no targets metadata about this target, abort the
1285
+ * ** 5.5. 1** . If there is no targets metadata about this target, abort the
1284
1286
update cycle and report that there is no such target.
1285
1287
1286
- * ** 5.2** . Otherwise, download the target (up to the number of bytes
1288
+ * ** 5.5. 2** . Otherwise, download the target (up to the number of bytes
1287
1289
specified in the targets metadata), and verify that its hashes match the
1288
1290
targets metadata. (We download up to this number of bytes, because in some
1289
1291
cases, the exact number is unknown. This may happen, for example, if an
@@ -1332,8 +1334,7 @@ snapshot metadata file.
1332
1334
repository. This ensures that an outdated client can always correctly
1333
1335
re-trace the chain of trust across multiple root key updates, even if the
1334
1336
latest set of root keys on the client dates back multiple root metadata
1335
- versions. See step 1 of the client application workflow in Section 5 for
1336
- more details.
1337
+ versions. See step 5.1 of the client application workflow for more details.
1337
1338
1338
1339
Note that an attacker, who controls the repository, can launch freeze
1339
1340
attacks by withholding new root metadata. The attacker does not need to
0 commit comments