@@ -1074,42 +1074,50 @@ repo](https://github.com/theupdateframework/specification/issues).
1074
1074
still be able to update again in the future. Errors raised during the update
1075
1075
process should not leave clients in an unrecoverable state.
1076
1076
1077
- ** 5.0** . ** Load the trusted root metadata file.** We assume that a good,
1077
+ ** 5.0** . ** Record the time at which the update began.** Add the update
1078
+ workflow maximum duration T to the recorded update start time to derive the
1079
+ fixed update expiration time. The value for T is set by the authors of the
1080
+ application using TUF. For example, T may be tens of minutes.
1081
+ This update expiration time will be used when checking for freeze attacks,
1082
+ and is fixed at the beginning of the update workflow to prevent metadata
1083
+ from expiring during an in-progress update.
1084
+
1085
+ ** 5.1** . ** Load the trusted root metadata file.** We assume that a good,
1078
1086
trusted copy of this file was shipped with the package manager or software
1079
1087
updater using an out-of-band process. Note that the expiration of the
1080
1088
trusted root metadata file does not matter, because we will attempt to update
1081
1089
it in the next step.
1082
1090
1083
- ** 5.1 ** . ** Update the root metadata file.** Since it may now be signed using
1091
+ ** 5.2 ** . ** Update the root metadata file.** Since it may now be signed using
1084
1092
entirely different keys, the client MUST somehow be able to establish a
1085
1093
trusted line of continuity to the latest set of keys (see Section 6.1). To do
1086
1094
so, the client MUST download intermediate root metadata files, until the
1087
1095
latest available one is reached. Therefore, it MUST temporarily turn on
1088
1096
consistent snapshots in order to download _ versioned_ root metadata files as
1089
1097
described next.
1090
1098
1091
- * ** 5.1 .1** . Let N denote the version number of the trusted root metadata
1099
+ * ** 5.2 .1** . Let N denote the version number of the trusted root metadata
1092
1100
file.
1093
1101
1094
- * ** 5.1 .2** . ** Try downloading version N+1 of the root metadata file** , up to
1102
+ * ** 5.2 .2** . ** Try downloading version N+1 of the root metadata file** , up to
1095
1103
some W number of bytes (because the size is unknown). The value for W is set
1096
1104
by the authors of the application using TUF. For example, W may be tens of
1097
1105
kilobytes. The filename used to download the root metadata file is of the
1098
1106
fixed form VERSION_NUMBER.FILENAME.EXT (e.g., 42.root.json). If this file is
1099
1107
not available, or we have downloaded more than Y number of root metadata
1100
- files (because the exact number is as yet unknown), then go to step 5.1 .9.
1108
+ files (because the exact number is as yet unknown), then go to step 5.2 .9.
1101
1109
The value for Y is set by the authors of the application using TUF. For
1102
1110
example, Y may be 2^10.
1103
1111
1104
- * ** 5.1 .3. Check for an arbitrary software attack.** Version N+1 of the root
1112
+ * ** 5.2 .3. Check for an arbitrary software attack.** Version N+1 of the root
1105
1113
metadata file MUST have been signed by: (1) a threshold of keys specified in
1106
1114
the trusted root metadata file (version N), and (2) a threshold of keys
1107
1115
specified in the new root metadata file being validated (version N+1). If
1108
1116
version N+1 is not signed as required, discard it, abort the update cycle,
1109
1117
and report the signature failure. On the next update cycle, begin at step
1110
- 5.0 and version N of the root metadata file.
1118
+ 5.1 and version N of the root metadata file.
1111
1119
1112
- * ** 5.1 .4. Check for a rollback attack.** The version number of the trusted
1120
+ * ** 5.2 .4. Check for a rollback attack.** The version number of the trusted
1113
1121
root metadata file (version N) MUST be less than or equal to the version
1114
1122
number of the new root metadata file (version N+1). Effectively, this means
1115
1123
checking that the version number signed in the new root metadata file is
@@ -1118,24 +1126,24 @@ repo](https://github.com/theupdateframework/specification/issues).
1118
1126
rollback attack. On the next update cycle, begin at step 5.0 and version N
1119
1127
of the root metadata file.
1120
1128
1121
- * ** 5.1 .5** . Note that the expiration of the new (intermediate) root metadata
1122
- file does not matter yet, because we will check for it in step 5.1 .9.
1129
+ * ** 5.2 .5** . Note that the expiration of the new (intermediate) root metadata
1130
+ file does not matter yet, because we will check for it in step 5.2 .9.
1123
1131
1124
- * ** 5.1 .6** . ** Set the trusted root metadata file** to the new root metadata
1132
+ * ** 5.2 .6** . ** Set the trusted root metadata file** to the new root metadata
1125
1133
file.
1126
1134
1127
- * ** 5.1 .7** . ** Persist root metadata.** The client MUST write the file to
1135
+ * ** 5.2 .7** . ** Persist root metadata.** The client MUST write the file to
1128
1136
non-volatile storage as FILENAME.EXT (e.g. root.json).
1129
1137
1130
- * ** 5.1 .8** . ** Repeat steps 5.1 .1 to 5.1 .8** .
1138
+ * ** 5.2 .8** . ** Repeat steps 5.2 .1 to 5.2 .8** .
1131
1139
1132
- * ** 5.1 .9** . ** Check for a freeze attack.** The latest known time MUST be
1133
- lower than the expiration timestamp in the trusted root metadata file
1140
+ * ** 5.2 .9** . ** Check for a freeze attack.** The fixed update expiration time
1141
+ MUST be lower than the expiration timestamp in the trusted root metadata file
1134
1142
(version N). If the trusted root metadata file has expired, abort the update
1135
1143
cycle, report the potential freeze attack. On the next update cycle, begin
1136
1144
at step 5.0 and version N of the root metadata file.
1137
1145
1138
- * ** 5.1 .10** . ** If the timestamp and / or snapshot keys have been rotated,
1146
+ * ** 5.2 .10** . ** If the timestamp and / or snapshot keys have been rotated,
1139
1147
then delete the trusted timestamp and snapshot metadata files.** This is done
1140
1148
in order to recover from fast-forward attacks after the repository has been
1141
1149
compromised and recovered. A _ fast-forward attack_ happens when attackers
@@ -1145,44 +1153,44 @@ repo](https://github.com/theupdateframework/specification/issues).
1145
1153
paper] ( https://ssl.engineering.nyu.edu/papers/kuppusamy-mercury-usenix-2017.pdf )
1146
1154
for more details.
1147
1155
1148
- * ** 5.1 .11** . ** Set whether consistent snapshots are used as per the trusted
1156
+ * ** 5.2 .11** . ** Set whether consistent snapshots are used as per the trusted
1149
1157
root metadata file** (see Section 4.3).
1150
1158
1151
- ** 5.2 ** . ** Download the timestamp metadata file** , up to X number of bytes
1159
+ ** 5.3 ** . ** Download the timestamp metadata file** , up to X number of bytes
1152
1160
(because the size is unknown). The value for X is set by the authors of the
1153
1161
application using TUF. For example, X may be tens of kilobytes. The filename
1154
1162
used to download the timestamp metadata file is of the fixed form FILENAME.EXT
1155
1163
(e.g., timestamp.json).
1156
1164
1157
- * ** 5.2 .1** . ** Check for an arbitrary software attack.** The new timestamp
1165
+ * ** 5.3 .1** . ** Check for an arbitrary software attack.** The new timestamp
1158
1166
metadata file MUST have been signed by a threshold of keys specified in the
1159
1167
trusted root metadata file. If the new timestamp metadata file is not
1160
1168
properly signed, discard it, abort the update cycle, and report the signature
1161
1169
failure.
1162
1170
1163
- * ** 5.2 .2** . ** Check for a rollback attack.**
1171
+ * ** 5.3 .2** . ** Check for a rollback attack.**
1164
1172
1165
- * ** 5.2 .2.1** . The version number of the trusted timestamp metadata file, if
1173
+ * ** 5.3 .2.1** . The version number of the trusted timestamp metadata file, if
1166
1174
any, MUST be less than or equal to the version number of the new timestamp
1167
1175
metadata file. If the new timestamp metadata file is older than the
1168
1176
trusted timestamp metadata file, discard it, abort the update cycle, and
1169
1177
report the potential rollback attack.
1170
1178
1171
- * ** 5.2 .2.2** . The version number of the snapshot metadata file in the
1179
+ * ** 5.3 .2.2** . The version number of the snapshot metadata file in the
1172
1180
trusted timestamp metadata file, if any, MUST be less than or equal to its
1173
1181
version number in the new timestamp metadata file. If not, discard the new
1174
1182
timestamp metadata file, abort the update cycle, and report the failure.
1175
1183
1176
- * ** 5.2 .3** . ** Check for a freeze attack.** The latest known time MUST be
1177
- lower than the expiration timestamp in the new timestamp metadata file. If
1178
- so, the new timestamp metadata file becomes the trusted timestamp metadata
1179
- file. If the new timestamp metadata file has expired, discard it, abort the
1180
- update cycle, and report the potential freeze attack.
1184
+ * ** 5.3 .3** . ** Check for a freeze attack.** The fixed update expiration time
1185
+ MUST be lower than the expiration timestamp in the new timestamp metadata
1186
+ file. If so, the new timestamp metadata file becomes the trusted timestamp
1187
+ metadata file. If the new timestamp metadata file has expired, discard it,
1188
+ abort the update cycle, and report the potential freeze attack.
1181
1189
1182
- * ** 5.2 .4** . ** Persist timestamp metadata.** The client MUST write the file
1190
+ * ** 5.3 .4** . ** Persist timestamp metadata.** The client MUST write the file
1183
1191
to non-volatile storage as FILENAME.EXT (e.g. timestamp.json).
1184
1192
1185
- ** 5.3 ** . ** Download snapshot metadata file** , up to either the number of bytes
1193
+ ** 5.4 ** . ** Download snapshot metadata file** , up to either the number of bytes
1186
1194
specified in the timestamp metadata file, or some Y number of bytes. The value
1187
1195
for Y is set by the authors of the application using TUF. For example, Y may be
1188
1196
tens of kilobytes. If consistent snapshots are not used (see
@@ -1192,25 +1200,25 @@ of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.snapshot.json), where
1192
1200
VERSION_NUMBER is the version number of the snapshot metadata file listed in
1193
1201
the timestamp metadata file.
1194
1202
1195
- * ** 5.3 .1** . ** Check against timestamp role's snapshot hash.** The hashes
1203
+ * ** 5.4 .1** . ** Check against timestamp role's snapshot hash.** The hashes
1196
1204
of the new snapshot metadata file MUST match the hashes, if any, listed in
1197
1205
the trusted timestamp metadata. This is done, in part, to prevent a
1198
1206
mix-and-match attack by man-in-the-middle attackers. If the hashes do not
1199
1207
match, discard the new snapshot metadata, abort the update cycle, and report
1200
1208
the failure.
1201
1209
1202
- * ** 5.3 .2** . ** Check for an arbitrary software attack.** The new snapshot
1210
+ * ** 5.4 .2** . ** Check for an arbitrary software attack.** The new snapshot
1203
1211
metadata file MUST have been signed by a threshold of keys specified in the
1204
1212
trusted root metadata file. If the new snapshot metadata file is not signed
1205
1213
as required, discard it, abort the update cycle, and report the signature
1206
1214
failure.
1207
1215
1208
- * ** 5.3 .3** . ** Check against timestamp role's snapshot version.** The version
1216
+ * ** 5.4 .3** . ** Check against timestamp role's snapshot version.** The version
1209
1217
number of the new snapshot metadata file MUST match the version number listed
1210
1218
in the trusted timestamp metadata. If the versions do not match, discard the
1211
1219
new snapshot metadata, abort the update cycle, and report the failure.
1212
1220
1213
- * ** 5.3 .4** . ** Check for a rollback attack.** The version number of the targets
1221
+ * ** 5.4 .4** . ** Check for a rollback attack.** The version number of the targets
1214
1222
metadata file, and all delegated targets metadata files, if any, in the
1215
1223
trusted snapshot metadata file, if any, MUST be less than or equal to its
1216
1224
version number in the new snapshot metadata file. Furthermore, any targets
@@ -1219,17 +1227,17 @@ the timestamp metadata file.
1219
1227
these conditions are not met, discard the new snapshot metadata file, abort
1220
1228
the update cycle, and report the failure.
1221
1229
1222
- * ** 5.3 .5** . ** Check for a freeze attack.** The latest known time MUST be
1230
+ * ** 5.4 .5** . ** Check for a freeze attack.** The latest known time MUST be
1223
1231
lower than the expiration timestamp in the new snapshot metadata file. If
1224
1232
so, the new snapshot metadata file becomes the trusted snapshot metadata
1225
1233
file. If the new snapshot metadata file is expired, discard it, abort the
1226
1234
update cycle, and report the potential freeze attack.
1227
1235
1228
1236
1229
- * ** 5.3 .6** . ** Persist snapshot metadata.** The client MUST write the file to
1237
+ * ** 5.4 .6** . ** Persist snapshot metadata.** The client MUST write the file to
1230
1238
non-volatile storage as FILENAME.EXT (e.g. snapshot.json).
1231
1239
1232
- ** 5.4 ** . ** Download the top-level targets metadata file** , up to either the
1240
+ ** 5.5 ** . ** Download the top-level targets metadata file** , up to either the
1233
1241
number of bytes specified in the snapshot metadata file, or some Z number of
1234
1242
bytes. The value for Z is set by the authors of the application using TUF. For
1235
1243
example, Z may be tens of kilobytes. If consistent snapshots are not used (see
@@ -1239,66 +1247,66 @@ of the form VERSION_NUMBER.FILENAME.EXT (e.g., 42.targets.json), where
1239
1247
VERSION_NUMBER is the version number of the targets metadata file listed in the
1240
1248
snapshot metadata file.
1241
1249
1242
- * ** 5.4 .1** . ** Check against snapshot role's targets hash.** The hashes
1250
+ * ** 5.5 .1** . ** Check against snapshot role's targets hash.** The hashes
1243
1251
of the new targets metadata file MUST match the hashes, if any, listed in the
1244
1252
trusted snapshot metadata. This is done, in part, to prevent a mix-and-match
1245
1253
attack by man-in-the-middle attackers. If the new targets metadata file does
1246
1254
not match, discard the new target metadata, abort the update cycle, and
1247
1255
report the failure.
1248
1256
1249
- * ** 5.4 .2** . ** Check for an arbitrary software attack.** The new targets
1257
+ * ** 5.5 .2** . ** Check for an arbitrary software attack.** The new targets
1250
1258
metadata file MUST have been signed by a threshold of keys specified in the
1251
1259
trusted root metadata file. If the new targets metadata file is not signed
1252
1260
as required, discard it, abort the update cycle, and report the failure.
1253
1261
1254
- * ** 5.4 .3** . ** Check against snapshot role's targets version.** The version
1262
+ * ** 5.5 .3** . ** Check against snapshot role's targets version.** The version
1255
1263
number of the new targets metadata file MUST match the version number listed
1256
1264
in the trusted snapshot metadata. If the versions do not match, discard it,
1257
1265
abort the update cycle, and report the failure.
1258
1266
1259
- * ** 5.4 .4** . ** Check for a freeze attack.** The latest known time MUST be
1267
+ * ** 5.5 .4** . ** Check for a freeze attack.** The latest known time MUST be
1260
1268
lower than the expiration timestamp in the new targets metadata file. If so,
1261
1269
the new targets metadata file becomes the trusted targets metadata file. If
1262
1270
the new targets metadata file is expired, discard it, abort the update cycle,
1263
1271
and report the potential freeze attack.
1264
1272
1265
- * ** 5.4 .5** . ** Persist targets metadata.** The client MUST write the file to
1273
+ * ** 5.5 .5** . ** Persist targets metadata.** The client MUST write the file to
1266
1274
non-volatile storage as FILENAME.EXT (e.g. targets.json).
1267
1275
1268
- * ** 5.4 .6** . ** Perform a pre-order depth-first search for metadata about the
1276
+ * ** 5.5 .6** . ** Perform a pre-order depth-first search for metadata about the
1269
1277
desired target, beginning with the top-level targets role.** Note: If
1270
- any metadata requested in steps 5.4 .6.1 - 5.4 .6.2 cannot be downloaded nor
1278
+ any metadata requested in steps 5.5 .6.1 - 5.5 .6.2 cannot be downloaded nor
1271
1279
validated, end the search and report that the target cannot be found.
1272
1280
1273
- * ** 5.4 .6.1** . If this role has been visited before, then skip this role
1281
+ * ** 5.5 .6.1** . If this role has been visited before, then skip this role
1274
1282
(so that cycles in the delegation graph are avoided). Otherwise, if an
1275
1283
application-specific maximum number of roles have been visited, then go to
1276
- step 5.5 (so that attackers cannot cause the client to waste excessive
1284
+ step 5.6 (so that attackers cannot cause the client to waste excessive
1277
1285
bandwidth or time). Otherwise, if this role contains metadata about the
1278
- desired target, then go to step 5.5 .
1286
+ desired target, then go to step 5.6 .
1279
1287
1280
- * ** 5.4 .6.2** . Otherwise, recursively search the list of delegations in
1288
+ * ** 5.5 .6.2** . Otherwise, recursively search the list of delegations in
1281
1289
order of appearance.
1282
1290
1283
- * ** 5.4 .6.2.1** . If the current delegation is a multi-role delegation,
1291
+ * ** 5.5 .6.2.1** . If the current delegation is a multi-role delegation,
1284
1292
recursively visit each role, and check that each has signed exactly the
1285
1293
same non-custom metadata (i.e., length and hashes) about the target (or
1286
1294
the lack of any such metadata).
1287
1295
1288
- * ** 5.4 .6.2.2** . If the current delegation is a terminating delegation,
1296
+ * ** 5.5 .6.2.2** . If the current delegation is a terminating delegation,
1289
1297
then jump to step 5.5.
1290
1298
1291
- * ** 5.4 .6.2.3** . Otherwise, if the current delegation is a
1299
+ * ** 5.5 .6.2.3** . Otherwise, if the current delegation is a
1292
1300
non-terminating delegation, continue processing the next delegation, if
1293
- any. Stop the search, and jump to step 5.5 as soon as a delegation
1301
+ any. Stop the search, and jump to step 5.6 as soon as a delegation
1294
1302
returns a result.
1295
1303
1296
- ** 5.5 ** . ** Verify the desired target against its targets metadata** .
1304
+ ** 5.6 ** . ** Verify the desired target against its targets metadata** .
1297
1305
1298
- * ** 5.5 .1** . If there is no targets metadata about this target, abort the
1306
+ * ** 5.6 .1** . If there is no targets metadata about this target, abort the
1299
1307
update cycle and report that there is no such target.
1300
1308
1301
- * ** 5.5 .2** . Otherwise, download the target (up to the number of bytes
1309
+ * ** 5.6 .2** . Otherwise, download the target (up to the number of bytes
1302
1310
specified in the targets metadata), and verify that its hashes match the
1303
1311
targets metadata. (We download up to this number of bytes, because in some
1304
1312
cases, the exact number is unknown. This may happen, for example, if an
@@ -1310,7 +1318,7 @@ snapshot metadata file.
1310
1318
(e.g.,
1311
1319
c14aeb4ac9f4a8fc0d83d12482b9197452f6adf3eb710e3b1e2b79e8d14cb681.foobar.tar.gz),
1312
1320
where HASH is one of the hashes of the targets file listed in the targets
1313
- metadata file found earlier in step 5.4 . In either case, the client MUST write
1321
+ metadata file found earlier in step 5.5 . In either case, the client MUST write
1314
1322
the file to non-volatile storage as FILENAME.EXT.
1315
1323
1316
1324
## ** 6. Usage**
@@ -1347,7 +1355,7 @@ snapshot metadata file.
1347
1355
repository. This ensures that an outdated client can always correctly
1348
1356
re-trace the chain of trust across multiple root key updates, even if the
1349
1357
latest set of root keys on the client dates back multiple root metadata
1350
- versions. See step 5.1 of the client application workflow for more details.
1358
+ versions. See step 5.2 of the client application workflow for more details.
1351
1359
1352
1360
Note that an attacker, who controls the repository, can launch freeze
1353
1361
attacks by withholding new root metadata. The attacker does not need to
0 commit comments