|
|
|
|
|
by vova_hn2
4 hours ago
|
|
> your validation logic simply should refuse any token before $NOW. Well, this approach throws out a lot of babies with the bathwater. You invalidate tons of legitimate tokens along with the one that you wanted to invalidate and get a thundering herd [0] of clients wishing to re-authenticate. This is probably not good in case of a really high load. And if you don't have a really high load, then there is no good reason not to have a stateful session storage. [0] https://en.wikipedia.org/wiki/Thundering_herd_problem |
|
You are not throwing out a lot of babies with the bathwater if you would do it in a case of a known attack. You would invalidate ALL tokens of a user, which is a sane default especially since usually you wouldn't be able to rule out what other tokens were compromised. And yes, if it later turned out ALL your users and all their token were possibly compromised because you had some kind of security flaw, setting a global minimum_issued_at is exactly what you would do after you fixed the flaw. And yes, that means all your users must reauthenticate.