better-auth is vulnerable to Insufficient Session Expiration
42
CVE Score
Medium
Insufficient Session Expiration
Revoked sessions in better-auth can remain valid in two cases. With secondaryStorage, the per-user session list is updated with a non-atomic read-then-write, so concurrent session changes can drop a token from the list and bulk revocation (revoke all sessions or ban user) misses that session. With session.cookieCache, passkey registration, device authorization, two-factor enrollment and verification, social account linking, and phone number changes accepted a cached (already revoked) session, letting it create a passkey or a new stored session that outlives the cache maxAge. Exploitation requires the attacker to already hold a valid session for the account; it lets them keep access after revocation but does not grant access without credentials. The fix records a cutoff time on bulk revocation and makes the affected routes read the session from the store instead of the cookie cache.
Upgrade the better-auth library to the patch version (and @better-auth/passkey as well if used). As a workaround, turn off session.cookieCache if revocation must take effect immediately, and stop using secondaryStorage for bulk revocation until you upgrade.
You are affected if you use better-auth with secondaryStorage (from 0.8.1), or with session.cookieCache together with passkey registration, device authorization, or passwordless two-factor enrollment (from 1.6.25), and you are using a version that falls within the vulnerable range.
0.8.1 - 1.7.15
Fixed in 1.7.16better-auth is vulnerable to Insufficient Session Expiration in versions 0.8.1 - 1.7.15.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.