GHSA-392p-2q2v-4372: Better Auth: OAuth refresh-token rotation forks the token family on concurrent redemption
A vulnerability in @better-auth/oauth-provider versions >=1.6.0 and <1.6.11 allows concurrent refresh token redemption to fork the refresh token family. This occurs because the refresh token rotation process is not atomic, enabling two concurrent requests using the same refresh token to both succeed and mint new tokens. This breaks the intended single-use refresh token rotation and can allow indefinite access token renewal until expiration or revocation. The issue is fixed in version 1.6.11 by implementing an atomic compare-and-swap operation during token rotation and adding a unique constraint on refresh tokens.
AI Analysis
Technical Summary
The OAuth provider's refresh token rotation endpoint performs a non-atomic sequence of read, validate, revoke, and mint operations on the refresh token record. When two concurrent requests redeem the same refresh token, both pass the revocation check before either revokes the token, resulting in both minting new refresh tokens and thus forking the token family. The root cause is that the update predicate does not include a 'revoked IS NULL' condition, allowing concurrent updates to succeed without error. The schema also lacks a unique constraint on refresh tokens, permitting concurrent token creation without collision. The fix in @better-auth/[email protected] adds an atomic compare-and-swap update with a rowcount check to ensure only one request succeeds, returning 'invalid_grant' to the loser. This prevents token family forks and enforces proper refresh token rotation per RFC 9700 §4.14. The patch also includes a unique constraint on the refresh token field and compatibility fixes for the in-memory adapter. No full strict family invalidation is implemented yet but planned for a future release.
Potential Impact
The vulnerability allows an attacker or client to redeem the same refresh token concurrently, resulting in multiple valid refresh tokens (a forked token family). This undermines the security guarantees of refresh token rotation, potentially allowing indefinite access token renewal with a stolen or reused refresh token until it expires or is revoked. This increases the risk of unauthorized long-term access to protected resources. However, the issue only affects applications using the affected versions and requesting the 'offline_access' scope to mint refresh tokens.
Mitigation Recommendations
Upgrade to @better-auth/oauth-provider version 1.6.11 or later, which includes an atomic compare-and-swap fix for refresh token rotation and adds a unique constraint on refresh tokens. If upgrading is not immediately possible, no full workaround closes the vulnerability; developers should avoid concurrent refresh token redemption scenarios (e.g., avoid sharing refresh tokens across browser tabs without mutexes or retrying refresh token requests concurrently). Monitor vendor advisories for further updates on strict family invalidation. The patch is available and should be applied promptly.
GHSA-392p-2q2v-4372: Better Auth: OAuth refresh-token rotation forks the token family on concurrent redemption
Description
A vulnerability in @better-auth/oauth-provider versions >=1.6.0 and <1.6.11 allows concurrent refresh token redemption to fork the refresh token family. This occurs because the refresh token rotation process is not atomic, enabling two concurrent requests using the same refresh token to both succeed and mint new tokens. This breaks the intended single-use refresh token rotation and can allow indefinite access token renewal until expiration or revocation. The issue is fixed in version 1.6.11 by implementing an atomic compare-and-swap operation during token rotation and adding a unique constraint on refresh tokens.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The OAuth provider's refresh token rotation endpoint performs a non-atomic sequence of read, validate, revoke, and mint operations on the refresh token record. When two concurrent requests redeem the same refresh token, both pass the revocation check before either revokes the token, resulting in both minting new refresh tokens and thus forking the token family. The root cause is that the update predicate does not include a 'revoked IS NULL' condition, allowing concurrent updates to succeed without error. The schema also lacks a unique constraint on refresh tokens, permitting concurrent token creation without collision. The fix in @better-auth/[email protected] adds an atomic compare-and-swap update with a rowcount check to ensure only one request succeeds, returning 'invalid_grant' to the loser. This prevents token family forks and enforces proper refresh token rotation per RFC 9700 §4.14. The patch also includes a unique constraint on the refresh token field and compatibility fixes for the in-memory adapter. No full strict family invalidation is implemented yet but planned for a future release.
Potential Impact
The vulnerability allows an attacker or client to redeem the same refresh token concurrently, resulting in multiple valid refresh tokens (a forked token family). This undermines the security guarantees of refresh token rotation, potentially allowing indefinite access token renewal with a stolen or reused refresh token until it expires or is revoked. This increases the risk of unauthorized long-term access to protected resources. However, the issue only affects applications using the affected versions and requesting the 'offline_access' scope to mint refresh tokens.
Mitigation Recommendations
Upgrade to @better-auth/oauth-provider version 1.6.11 or later, which includes an atomic compare-and-swap fix for refresh token rotation and adds a unique constraint on refresh tokens. If upgrading is not immediately possible, no full workaround closes the vulnerability; developers should avoid concurrent refresh token redemption scenarios (e.g., avoid sharing refresh tokens across browser tabs without mutexes or retrying refresh token requests concurrently). Monitor vendor advisories for further updates on strict family invalidation. The patch is available and should be applied promptly.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-392p-2q2v-4372
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-53517"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
Threat ID: 6a4e4ef7c9d9e3dbe328cc06
Added to database: 07/08/2026, 13:21:59 UTC
Last enriched: 07/08/2026, 13:44:35 UTC
Last updated: 07/08/2026, 13:44:35 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.