Comment on Windows feature that resets system clocks based on random data is wreaking havoc
excel@lemmy.megumin.org 1 year ago
Sounds like the heuristic is taking multiple samples only uses them if they are within some consistency threshold, to hedge against the cases where the field has random data.
The reason it only fails rarely and randomly is because it only happens when multiple actually random timestamps happen to line up around the same time.
Sort of like how several applications have failure modes when two different files happen to have the same hash.
Turns out developers are bad at statistics and probabilities.
towerful@programming.dev 1 year ago
Hmm, the birthday problem alludes to what’s going on, except the birthday problem discards the year and the time.
If it’s 2x 32bit random timestamps that have to align within a 10 minute window (600 seconds) it’s a probability of 600 in 4.3 billion (uint32 max).
Still vanishingly small.
However, if a server makes 10 requests as part of STS, and you have 5000 servers, then there is a significantly higher chance of a server being hit.
That is, of course, assuming all server clocks slip enough to trigger this, and that all STS timestamps are random 32bit.
And there might be something in the way that 32bit timestamp is randomised. As it’s part of a cryptography system, it would make sense to be cryptographically secure. But seeing as it’s not directly part of the cryptographic process, it could be a cheaper/faster RNG.
candybrie@lemmy.world 1 year ago
The server clocks don’t actually have to slip at all to trigger this. They just have to not match up with whatever the STS comes up with as the time.