We are trying to utilize refresh tokens in a SPA web site. To do so we had to reduce our security settings by not requiring client authentication so that it was able to exchange the refresh token for an access token.
We are okay with this since we also have "require PKCE" if no client secret is passed in, but wanted to verify that the refresh token itself was not a source of risk.
I can't prove that the refresh token (essentially a bearer token now) is either:
- Sender Constrained
- Refresh Token Rotation Implemented
We did a test for #2 with "one time use" on, expecting the refresh chain to be rejected in the detection of an "attack".
Issue a /authorize and get a code
Exchange code for tokens (includes refresh token)
Use refresh token to get a new (access token, refresh token) pair
Use OLD refresh token again to attempt to get a new pair, this fails [so far so good]
Use NEW refresh token from step above to get a pair
The expectation is that the NEW refresh token is revoked due to the "attack" detected with the use of the OLD refresh token. Essentially we should assume that the credentials were stolen and used maliciously.
However, that doesn't happen with FA. Instead, the refresh token is allowed to get a new access token.
This allows the following attack:
- Attacker/Malicious code gains access to refresh token
- Attacker immediately uses refresh token to gain new access token
- Real code attempts to get a new access token and is refused due to one-time
- Attacker continues to use refresh chain to access application
I'm trying to prove that refresh tokens are "safe" to use in a public client and would like some guidance since I can't find any information about how the above attack is mitigated in Fusion Auth. Does anything else mitigate this attack?
Thanks!
PingIdentity Blog Post on Refresh Token Rotation
Auth0 Blog Post on Refresh Token Rotation