Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GHSA-392p-2q2v-4372: Better Auth: OAuth refresh-token rotation forks the token family on concurrent redemption

0
High
Published: 07/07/2026 (07/07/2026, 20:55:48 UTC)
Source: GCVE Database
Product: @better-auth/oauth-provider

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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Affected software

npmghsa
@better-auth/oauth-provider
Affected versions
>=1.6.0 <1.6.11
npmghsa
better-auth
Affected versions
>=1.4.8-beta.7 <1.6.0

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

AILast updated: 07/08/2026, 13:44:35 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses