Skip to main content

better-auth EUVDEUVD-2026-51828

| CVE-2026-67334 MEDIUM
Incomplete Cleanup (CWE-459)
2026-08-01 VulnCheck GHSA-gj53-4jmf-7745
5.1
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Admin deletes user via removeUser or SCIM
  2. Delivery
    deleteUser called without deleteSessions
  3. Exploit
    Session payload persists in Redis/KV cache
  4. Execution
    Deleted user presents stale session token
  5. Persist
    Server validates token against secondary storage
  6. Impact
    Authenticated 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

better-auth 0.3.4 <1.6.11
better-auth 1.6.0 <1.6.11

Affected Packages

npm @better-auth/scim fix: 1.6.11
npm better-auth fix: 1.6.11

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

Vendor (VulnCheck) PRIMARY 5.1 MEDIUM
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
vuln.today AI 4.8 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 01, 2026 - 13:01 EUVD

DescriptionCVE.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

EPSS Score
0.2%
Top 90% exploitable
Prevalence
Low
newer TypeScript auth library, limited enterprise footprint versus established alternatives
Social Media
4
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment CIRCL GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

CVE-2024-56734 HIGH POC
7.9 Dec 30

Better Auth is an authentication library for TypeScript. Rated high severity (CVSS 7.9), this vulnerability is remotely

CVE-2026-41427 HIGH POC
7.1 Apr 24

Authorization bypass in the @better-auth/oauth-provider plugin for Better Auth (versions >= 1.4.8-beta.7 and < 1.6.5, pl

CVE-2026-67330 CRITICAL
9.4 Aug 01

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

CVE-2026-67336 CRITICAL
9.4 Aug 01

Authentication bypass in Better Auth before 1.6.11 stems from insecure cryptographic defaults in the legacy oidcProvider

CVE-2025-71401 CRITICAL
9.3 Aug 02

Denial of service in Better Auth (npm) before 1.4.2 lets an unauthenticated remote attacker poison the router's base pat

CVE-2026-114607 CRITICAL
9.1 Oct 22

Unauthenticated OAuth state values can be redeemed as Magic Link tokens in Better Auth 1.4.0-beta.18 through 1.7.6, lett

CVE-2026-110864 CRITICAL
9.1 Oct 14

Authentication bypass in Better Auth's OAuth Proxy plugin (versions 1.5.0-beta.12 through 1.7.6) lets unauthenticated re

CVE-2025-71399 HIGH
8.8 Aug 02

Path normalization bypass in Better Auth before v1.4.5 allows unauthenticated remote attackers to circumvent `disabledPa

CVE-2026-67331 HIGH
8.7 Aug 01

Authorization bypass in @better-auth/scim versions 1.5.0 through 1.7.0-beta.3 allows any authenticated user to fully tak

CVE-2026-67327 HIGH
8.7 Aug 01

Pre-account hijacking in better-auth (npm) allows a remote attacker to gain persistent, password-based access to any vic

CVE-2026-67328 HIGH
8.6 Aug 01

Multiple authentication bypass vulnerabilities in @better-auth/sso before version 1.6.21 enable low-privileged attackers

CVE-2026-80192 HIGH
8.6 Aug 25

Two domain-ownership authentication bypass flaws in @better-auth/sso allow authenticated organization owners to compromi

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy