Reject DeviceCheck assertions if they race with a counter update

This commit is contained in:
Ravi Khadiwala 2026-04-10 14:08:43 -05:00 committed by ravi-signal
parent 75948dc617
commit 5bb7edcade

View File

@ -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);
}