Skip to main content

Better Auth EUVDEUVD-2026-132251

| CVE-2026-134313 HIGH
Race Condition (CWE-362)
2026-11-21 VulnCheck GHSA-797g-cqxm-j7fj
7.6
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Authenticate during concurrent sign-in load
  2. Delivery
    Insert triggers separate LAST_INSERT_ID() query
  3. Exploit
    Query resolves on different pooled connection
  4. Execution
    Receive another user's session ID
  5. Impact
    Act as victim user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Concurrency control, locking
MITRE ATT&CK

1 technique across 1 tactic: Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation is limited to deployments where ALL of the following hold (per the vendor advisory): the database is MySQL or MariaDB; advanced.database.generateId is set to 'serial' (a non-default ID mode); and the default Kysely adapter or the Drizzle adapter is used with a connection pool. The flaw does not occur with other databases, other ID settings, or default configuration. Trigger additionally requires concurrent sign-in/sign-up load so that the follow-up LAST_INSERT_ID() query lands on a different pooled connection. Key limiting factors: the attacker must be able to authenticate (PR:L), cannot choose which victim account is returned, and the condition is a timing race (AC:H/AT:P) rather than a deterministic request; a single-connection pool does NOT prevent it.

Impact

This is a genuine, non-theoretical risk despite not being a top-tier emergency. The CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:L/UI:N) and the vuln.today 'this_week' decision label align: it is network-reachable and carries high confidentiality and integrity impact (VC:H/VI:H) because a user can receive another user's authenticated session, but exploitation is probabilistic - AC:H and AT:P reflect that the race only manifests under concurrent load and the attacker cannot choose which account they receive. No EPSS score was provided and the vulnerability is not on CISA KEV, so there is no signal of active exploitation; no verified exploit code reference is present either. The most important nuance is that this is not a flaw in default configurations: per the vendor GHSA advisory it requires MySQL or MariaDB plus the non-default advanced.database.generateId: 'serial' setting plus a pooled Kysely/Drizzle adapter. The signals are therefore consistent rather than conflicting - moderately high technical impact gated by specific configuration and by an uncontrollable race - making this a real 'patch this week' item for affected deployments but a non-issue for the majority running default ID generation or other databases.

Exploit ScenarioDerived

On an affected deployment (MySQL/MariaDB with generateId: 'serial' and a pooled adapter), two users sign in at nearly the same moment; the adapter reads back the new row ID via a separate LAST_INSERT_ID() query that lands on a different pooled connection, so one user is handed the other's session and can act as that account. This can also surface during sign-up, returning another user's record. No public exploit code is referenced, and the attacker cannot steer which victim account they receive - exploitation is opportunistic under ordinary concurrent load rather than reliably targeted.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Nov 21, 2026

Better Auth versions before 1.7.16, and 1.8.0-beta.0 through 1.8.0-beta.4 on the beta line, can hand one user's session to a different user when running on MySQL or MariaDB with advanced.database.generateId: "serial". Because the inserted row's ID is fetched with a separate LAST_INSERT_ID() query that may land on a different pooled connection, concurrent sign-in or sign-up traffic can return another request's record - letting an authenticated user act as whichever account they happen to receive, though they cannot choose the victim. Exploitation requires the non-default serial ID mode plus a connection pool, and is a timing race rather than a deterministic request; the vendor advisory is GHSA-48c2-w96j-mv3m and fixed releases are 1.7.16 and 1.8.0-beta.5. No public exploit code was identified at time of analysis and there is no CISA KEV entry, but the flaw is a genuine cross-account session integrity risk for deployments matching the prerequisites.

RemediationAI

Vendor-released patch: upgrade better-auth and the matching adapter package (@better-auth/kysely-adapter or @better-auth/drizzle-adapter) to 1.7.16, or to 1.8.0-beta.5 if you are on the 1.8 beta line - both branches must be moved to their respective fixed versions, since better-auth below 1.7.16 and 1.8.0-beta.0 through 1.8.0-beta.4 are affected. The full upgrade matrix and patch details are in the vendor advisory at https://github.com/better-auth/better-auth/security/advisories/GHSA-48c2-w96j-mv3m, with additional tracking at https://www.vulncheck.com/advisories/better-auth-before-1.7.16-and-1.8.0-beta.0-before-1.8.0-beta.5-session-mix-up-via-mysql-serial-ids. If upgrading cannot be completed immediately, the vendor's only stated workaround is to stop using advanced.database.generateId: "serial" on MySQL - switching to the default ID generation removes the vulnerable LAST_INSERT_ID() read-back path; note that shrinking to a single-connection pool does not prevent the issue and carries a throughput penalty without security benefit here. Because exploitation depends on concurrent sign-in/sign-up load, deployments matching all three prerequisites (MySQL/MariaDB, serial ID mode, pooled Kysely or Drizzle adapter) should treat this as this week's priority, while also reviewing session and user records created under load for signs of cross-account mix-ups.

Affected VersionsENISA

drizzle-adapter 1.8.0-beta.0 <1.8.0-beta.5
better-auth 0 <1.7.16
better-auth 1.8.0-beta.0 <1.8.0-beta.5
drizzle-adapter 1.5.0-beta.9 <1.7.16
kysely-adapter 1.5.0-beta.9 <1.7.16
kysely-adapter 1.8.0-beta.0 <1.8.0-beta.5

Affected Packages

euvd better_auth fix: 1.7.16, 1.8.0-beta.5
euvd drizzle_adapter fix: 1.7.16, 1.8.0-beta.5
euvd kysely_adapter fix: 1.7.16, 1.8.0-beta.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in euvd

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 TypeScript/Node.js authentication library whose database access is abstracted through adapters - the default Kysely adapter and the @better-auth/drizzle-adapter package - both sitting on top of a connection pool. The root cause is CWE-362 (concurrent execution using a shared resource with improper synchronization), with the consequence documented by the vendor as CWE-488 (exposure of a data element to the wrong session). On the MySQL branch, the adapter performed the INSERT through the pool and then read the generated key back with a separate LAST_INSERT_ID() query executed in a separate transaction. MySQL and MariaDB scope LAST_INSERT_ID() to the individual connection, so when the follow-up query is dispatched on a different pooled connection it returns the ID of whatever row that connection inserted last - potentially belonging to a completely different concurrent request. The patched adapters use the ID reported directly by the insert itself and fail rather than guessing when no ID is reported, eliminating the cross-connection read. Affected configurations are narrow and explicitly enumerated by the vendor: MySQL or MariaDB as the database, advanced.database.generateId set to serial (not the default ID strategy), and either the default Kysely adapter or the Drizzle adapter with a connection pool. Other databases, other ID settings, and configurations not using a pool are not affected, and the vendor notes that restricting to a single-connection pool does not prevent the issue.

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 7.6 HIGH
CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
vuln.today AI 6.8 MEDIUM

Network-reachable auth flow (AV:N) but gated by an uncontrollable concurrency race and non-default serial-ID config (AC:H); a signed-in user is required (PR:L); session takeover yields C:H/I:H, availability unaffected for the attacker's goal (A:N).

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

Lifecycle Timeline

2
Patch available
Nov 21, 2026 - 18:02 EUVD
CVE Published
Nov 21, 2026 - 16:34 cve.org
HIGH 7.6

DescriptionCVE.org

Better Auth (better-auth, @better-auth/kysely-adapter, and @better-auth/drizzle-adapter) before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 contains a race condition with MySQL or MariaDB serial IDs because the inserted row's ID is read via a separate LAST_INSERT_ID() query that may run on a different pooled connection. Under concurrent load, a user signing in can receive another user's session and act as that user.

Technical POC Analysis

CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization), with the advisory also tagging CWE-488 (Exposure of Data Element to Wrong Session).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A session integrity vulnerability in Better Auth (versions before 1.7.16 and 1.8.0-beta.0-beta.4) on MySQL/MariaDB with serial ID mode can cause authenticated users to be assigned another user's session during concurrent traffic, enabling cross-account access. This undermines trust in authentication and could expose sensitive user data or allow unauthorized actions, affecting any deployment that meets the non-default configuration prerequisites.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 70% exploitable
Prevalence
Medium
popular TypeScript auth library, but only non-default serial-ID MySQL/MariaDB pooled setups affected
Data Quality
5 sources
Confidence: Medium

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 HIGH
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
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.

Race conditions occur when multiple concurrent requests exploit the brief time gap between checking a condition and acting upon it (TOCTOU - Time of Check, Time of Use).

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-2026-121802 CRITICAL
9.1 Nov 04

Account takeover in @better-auth/expo (1.4.0-beta.6 through 1.7.15, and 1.8.0-beta.0 through 1.8.0-beta.4) lets an unaut

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-134322 HIGH
8.6 Nov 21

Improper authentication in the better-auth phone number plugin (0.4.12-beta.7 through 1.7.15, and 1.8.0-beta.0 through 1

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