Reject DeviceCheck assertions if they race with a counter update

This commit is contained in:
Ravi Khadiwala authored and ravi-signal committed 2026-04-13 17:01:25 -05:00
1 parent 75948dc617
commit 5bb7edcade
1 file changed
+3 -1
@@ -206,7 +206,9 @@ public class AppleDeviceCheckManager {
}
// Store the updated sign count, so we can check the next assertion (step 6)
appleDeviceChecks.updateCounter(account, keyId, appleDevice.getCounter());
if (!appleDeviceChecks.updateCounter(account, keyId, appleDevice.getCounter())) {
throw new RequestReuseException("Sign count from request less than stored sign count");
}
removeChallenge(redisChallengeKey);
}