Skip to content

fix(auth): revoke refresh token family on reuse detection - #293

Open
jaharoni wants to merge 1 commit into
nulab:mainfrom
jaharoni:fix/refresh-token-family-reuse-175
Open

jaharoni wants to merge 1 commit into
nulab:mainfrom
jaharoni:fix/refresh-token-family-reuse-175

Conversation

@jaharoni

@jaharoni jaharoni commented Nov 3, 2026

Copy link
Copy Markdown

Closes #175.

Previously, consumeMcpRefreshToken deleted refresh tokens immediately upon first redemption. Because redeemed tokens left no trace in the store, replaying a stolen or already-rotated refresh token looked identical to presenting an unknown token, leaving the active rotated access and refresh tokens in the same grant family valid.

This change assigns a familyId across the authorization code exchange and subsequent refresh rotations, and retains redeemed refresh token metadata until family expiry. If an already-redeemed refresh token is presented again, the store logs a security warning and revokes all access tokens, cached verifications, and refresh tokens sharing that familyId while keeping unrelated token families intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] Revoke the whole refresh token family on reuse detection

1 participant