Summary
persistRefreshSession issues a new refresh token on each use but does not invalidate the entire token family when a previously-used (revoked) token is presented. This means:
- Attacker steals refresh token T1.
- Legitimate user refreshes: T1 is revoked, T2 is issued.
- Attacker uses T1 again - this should be a theft signal.
- Instead of revoking the entire family (T2, T3, ...), the server returns a generic 401.
- Attacker's session via T1 is blocked but no alert fires and the legitimate user's session remains valid even though the token was definitely stolen.
Impact
Silent session token compromise. The legitimate user is never notified and the attacker can retain access via any token in the family that has not yet been rotated.
Suggested Fix
When a token from a known-revoked family is reused, immediately invalidate all active tokens in that refresh chain and force the user to re-authenticate.
Summary
persistRefreshSessionissues a new refresh token on each use but does not invalidate the entire token family when a previously-used (revoked) token is presented. This means:Impact
Silent session token compromise. The legitimate user is never notified and the attacker can retain access via any token in the family that has not yet been rotated.
Suggested Fix
When a token from a known-revoked family is reused, immediately invalidate all active tokens in that refresh chain and force the user to re-authenticate.