docs icon indicating copy to clipboard operation
docs copied to clipboard

refresh-token-rotation.md with partial attack

Open HunderlineK opened this issue 4 years ago • 2 comments

Demonstrates the usefulness of 'Automatic reuse detection' by detailing how it can mitigate a partially successful attack. The current documentation for Automatic reuse detection has an example of how it completely prevents an attack, but in doing so it fails to note that there is still a window of attack.

I suspect the original example was written only with replay attacks in mind.

HunderlineK avatar Apr 16 '20 14:04 HunderlineK

I just realized the associated diagram on the web page needs to be updated as well; unfortunately, I don't have access to the tools for creating that.

HunderlineK avatar Apr 19 '20 13:04 HunderlineK

There is also another vector of attack with even a more significant impact: if the legitimate client never uses the refresh token e.g. user leaves their session before the expiry of their first token, then the automatic invalidation will never be invoked, and the malicious client can keep using the token.

Compared to a cookie-based approach, the rotating refresh token leaves open a rathe glaringly vector of attack open.

Perhaps it could be mitigated with required PKCE for every request? Or maybe that's what implemented under the hood if SDK is used and it is just not documented?

HunderlineK avatar Apr 20 '20 16:04 HunderlineK