Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAdmin deletes user via removeUser or SCIM
-
DeliverydeleteUser called without deleteSessions
-
ExploitSession payload persists in Redis/KV cache
-
ExecutionDeleted user presents stale session token
-
PersistServer validates token against secondary storage
-
ImpactAuthenticated access maintained for up to 7 days
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Incomplete cleanup
|
| Exploitation Conditions | All three of the following conditions must hold simultaneously for the vulnerability to be exploitable: (1) secondaryStorage must be configured on the betterAuth() initialization - for example, a Redis adapter or Cloudflare KV; (2) session.storeSessionInDatabase must be false or unset, which is the library default; and (3) user deletion must be triggered through one of the four affected endpoints - the admin plugin's removeUser API, the anonymous plugin's /delete-anonymous-user endpoint or its after-link hook, or the SCIM plugin's DELETE /scim/v2/Users/:userId route. Deployments using only the core /delete-user self-delete flow are NOT vulnerable. Exploitation of the lingering session itself requires only possession of a valid session token that was issued before deletion - no current account credentials or elevated privileges are needed at that point. The combination of a non-default external cache configuration and specific deletion endpoint routing limits the realistic exposure population. |
| Impact | The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:H) scores 5.1 and reflects that high privileges are needed to trigger the vulnerable deletion operation. However, the operational risk picture is more nuanced: the actor who exploits the lingering session is not necessarily the admin who performed the deletion - it is whoever possesses the old session token, which could be a terminated employee, an attacker who previously compromised the account, or a shared-session scenario. From that angle, the exploitation step itself requires no current privileges. Real-world risk is meaningfully gated by the required configuration intersection: secondaryStorage must be in use AND storeSessionInDatabase must be false (the default) AND deletion must route through one of the four affected endpoints. Deployments using only database-backed sessions are entirely unaffected. No EPSS data was provided in the input. No KEV listing and no POC are reported, suggesting low active exploitation pressure at time of analysis. For organizations running Redis-backed better-auth with admin or SCIM user management, however, the risk of access persistence after offboarding is concrete and should be treated as a priority. |
| Exploit ScenarioDerived | A company terminates an employee and an administrator uses the better-auth admin plugin to call removeUser. Because the deployment uses Redis as secondaryStorage with the default storeSessionInDatabase=false, the employee's existing session token is never evicted from Redis. The former employee, still in possession of their session cookie, continues to make authenticated API requests for up to seven days, potentially accessing sensitive data or performing write operations under their former identity. No public exploit code has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 01, 2026
Stale session persistence in better-auth allows deleted users to maintain authenticated access for up to seven days after account removal. Affected are deployments of better-auth versions 0.3.4 through 1.6.10 running with secondaryStorage (Redis, KV, or similar external cache) and the default storeSessionInDatabase=false setting, where user deletion flows through the admin, anonymous, or SCIM plugins. Because deleteSessions is never called before deleteUser in these code paths, the session payload remains live in the cache until TTL expiry, meaning a terminated employee or compromised account that has been administratively deleted can continue making authenticated requests. No public exploit code has been identified at time of analysis, and the issue is not listed in CISA KEV.
RemediationAI
Upgrade to better-auth@1.6.11 (and @better-auth/scim@1.6.11 if the SCIM plugin is in use), as confirmed by npm package metadata and the GHSA advisory at https://github.com/better-auth/better-auth/security/advisories/GHSA-2vg6-77g8-24mp. The fix extends all four vulnerable call sites to invoke deleteSessions(userId) before deleteUser(userId) and includes an architectural follow-up to centralize cleanup inside deleteUser. If immediate upgrade is not feasible, setting session.storeSessionInDatabase to true eliminates the vulnerability entirely because database-level cascades then handle session removal - trade-off is increased database read load for session lookups. A second workaround is to manually flush the deleted user's session keys from secondary storage (Redis DEL or KV delete) at the application layer immediately after calling removeUser; this requires custom wrapper code and carries a risk of implementation gaps. Reducing session TTL below the default seven days limits the exploitation window but does not eliminate it. No compensating control short of the upgrade or storeSessionInDatabase=true fully closes the gap.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
better-auth is a Node.js/TypeScript authentication library distributed via npm (cpe:2.3:a:better-auth:better-auth:*:*:*:*:*:*:*:*). When secondaryStorage is configured, session tokens are stored in an external cache (Redis, Cloudflare KV, etc.) rather than solely in the primary database. CWE-459 (Incomplete Cleanup) is the root cause: four specific deletion call sites - admin plugin removeUser (packages/better-auth/src/plugins/admin/routes.ts:1463), anonymous plugin self-delete (packages/better-auth/src/plugins/anonymous/index.ts:222), anonymous plugin after-link hook (index.ts:325), and SCIM DELETE /scim/v2/Users/:userId (packages/scim/src/routes.ts:1019) - invoke internalAdapter.deleteUser(userId) without first calling internalAdapter.deleteSessions(userId). The session record in secondary storage is never evicted, so findSession(token) continues to resolve the deleted user's cached session object as valid until the 7-day default TTL elapses. By contrast, the core /delete-user self-delete and /delete-user/callback routes already call deleteSessions correctly and are not vulnerable.
Know when Better Auth gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Exploiting the stale session needs no current privileges (account is deleted), but requires a specific non-default deployment configuration - secondaryStorage plus storeSessionInDatabase=false - warranting AC:H.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
better-auth versions before 1.6.11 fail to delete cached sessions when removing users via admin, anonymous, or SCIM endpoints when secondaryStorage is configured and storeSessionInDatabase is false. Attackers can reuse deleted user session tokens to maintain authentication for up to seven days after account deletion.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
More in Better Auth
View allBetter Auth is an authentication library for TypeScript. Rated high severity (CVSS 7.9), this vulnerability is remotely
Authorization bypass in the @better-auth/oauth-provider plugin for Better Auth (versions >= 1.4.8-beta.7 and < 1.6.5, pl
Privilege-escalating account takeover in the @better-auth/scim plugin (versions 1.4.0-beta.27 through 1.6.21 and 1.7.0-b
Authentication bypass in Better Auth before 1.6.11 stems from insecure cryptographic defaults in the legacy oidcProvider
Denial of service in Better Auth (npm) before 1.4.2 lets an unauthenticated remote attacker poison the router's base pat
Unauthenticated OAuth state values can be redeemed as Magic Link tokens in Better Auth 1.4.0-beta.18 through 1.7.6, lett
Authentication bypass in Better Auth's OAuth Proxy plugin (versions 1.5.0-beta.12 through 1.7.6) lets unauthenticated re
Path normalization bypass in Better Auth before v1.4.5 allows unauthenticated remote attackers to circumvent `disabledPa
Authorization bypass in @better-auth/scim versions 1.5.0 through 1.7.0-beta.3 allows any authenticated user to fully tak
Pre-account hijacking in better-auth (npm) allows a remote attacker to gain persistent, password-based access to any vic
Multiple authentication bypass vulnerabilities in @better-auth/sso before version 1.6.21 enable low-privileged attackers
Two domain-ownership authentication bypass flaws in @better-auth/sso allow authenticated organization owners to compromi
EUVD-2026-51828
GHSA-gj53-4jmf-7745
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB