There's a signal inside the grace window that can separate a retry from a theft: whether the replacement token has been used yet. A lost response means the browser never received the new refresh token, so it can't present it. If the new token has already come back to the server and the old one shows up after that, the request isn't a retry from a dropped response. Two parties are holding the same session. RFC 9700 (section 4.14.2) describes the response for that case: the server can't tell which side is the attacker, so it revokes the active token and the client has to log in again.
With rotation down to once a day per session, the check is cheap. Keep the replacement's id on the revoked row, record when it was first used, and honour the 60 seconds only while that field is empty. It won't catch a replay that lands before the browser's next refresh, but someone mashing Ctrl+F5 keeps their login, and a stolen token presented after the real refresh ends the session instead of minting a fresh access token.
Thanks, Mike — that's a sharper test than time alone. Right now the grace window only asks when the token died; checking whether its replacement has already been used would separate a retry from a replay, which is exactly the RFC 9700 §4.14.2 distinction. Recording the replacement id and first-use time on the revoked row is the clean way to keep that state. Appreciate the close read — I'll weigh it against the extra state before changing anything.
Mike Dabydeen
There's a signal inside the grace window that can separate a retry from a theft: whether the replacement token has been used yet. A lost response means the browser never received the new refresh token, so it can't present it. If the new token has already come back to the server and the old one shows up after that, the request isn't a retry from a dropped response. Two parties are holding the same session. RFC 9700 (section 4.14.2) describes the response for that case: the server can't tell which side is the attacker, so it revokes the active token and the client has to log in again.
With rotation down to once a day per session, the check is cheap. Keep the replacement's id on the revoked row, record when it was first used, and honour the 60 seconds only while that field is empty. It won't catch a replay that lands before the browser's next refresh, but someone mashing Ctrl+F5 keeps their login, and a stolen token presented after the real refresh ends the session instead of minting a fresh access token.