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-2vg6-77g8-24mp: Better Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flows

0
Low
Published: 07/07/2026 (07/07/2026, 20:56:45 UTC)
Source: GCVE Database
Product: better-auth

Description

A vulnerability in better-auth causes stale user sessions to persist after user deletion when using external session caches and the session is not stored in the database. This affects user deletion flows in the admin, anonymous, and SCIM plugins, allowing deleted users' sessions to remain valid until the session TTL expires (default 7 days). The issue is fixed in patched versions of better-auth and @better-auth/scim, which ensure sessions are deleted before user records. Workarounds include enabling session storage in the database or explicitly revoking sessions in code. The impact is limited to session persistence post-deletion, with no known exploits in the wild.

CVSS v3.1

Attack Vector
Network
Attack Complexity
Low
Privileges Required
High
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N

Affected software

npmghsa
better-auth
Affected versions
>=0.3.4 <1.6.11
npmghsa
@better-auth/scim
Affected versions
>=1.6.0 <1.6.11

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:10 UTC

Technical Analysis

When better-auth is configured with secondaryStorage (e.g., Redis) and session.storeSessionInDatabase is false (default), user deletion endpoints in admin, anonymous, and SCIM plugins fail to delete user sessions before deleting the user record. As a result, session payloads cached in secondary storage remain valid until their TTL expires, allowing deleted users to authenticate during that window. The vulnerability affects versions >=0.3.4 <1.6.11 and >=1.6.0 <1.6.11. The fix involves modifying these endpoints to call deleteSessions(userId) before deleteUser(userId). Workarounds include enabling session storage in the database or explicitly revoking sessions via API calls. This vulnerability corresponds to CWE-459, CWE-613, and CWE-672.

Potential Impact

Deleted users retain valid sessions in external caches for up to the session TTL (default 7 days), allowing continued access to resources with their previous permissions. This undermines user deprovisioning, especially in SCIM-driven offboarding scenarios, where active sessions are not revoked immediately. No known exploits have been reported in the wild. The severity is low due to the requirement of authenticated privileges to delete users and the limited window of session persistence.

Mitigation Recommendations

A fix is available in patched versions of better-auth and @better-auth/scim that ensure sessions are deleted before user records. Users should upgrade to these patched versions as soon as possible. If immediate upgrade is not feasible, workarounds include setting session.storeSessionInDatabase to true to leverage database cascades for session deletion, or explicitly revoking user sessions via API calls (auth.api.revokeUserSessions) in admin, SCIM, and anonymous user deletion flows. These mitigations eliminate the stale session persistence gap.

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-2vg6-77g8-24mp
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
LOW
Cvss Version
3.1

Threat ID: 6a4e4ef7c9d9e3dbe328cbf7

Added to database: 07/08/2026, 13:21:59 UTC

Last enriched: 07/08/2026, 13:44:10 UTC

Last updated: 07/09/2026, 01:03:35 UTC

Views: 5

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