Read the docs

Race condition in Better Auth lets users receive others' sessions

Priority LOW 33CWE-362Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
High
Attack requirements
Present
Impact type
—
Confidentiality · integrity · availability
High · High · None
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA.

Summary

The better-auth package before 1.7.16 and from 1.8.0-beta.0 before 1.8.0-beta.5, and the @better-auth/kysely-adapter and @better-auth/drizzle-adapter packages from 1.5.0-beta.9 before 1.7.16 and from 1.8.0-beta.0 before 1.8.0-beta.5, are affected. A race condition with MySQL or MariaDB serial IDs (CWE-362) occurs because the inserted row's ID is read with 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.

Written with Claude Haiku 5.5 from the sources below · 2026-11-21

Description from the CNA

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.

Why it matters now

EPSS 0.00267 11th percentileScored 2026-11-30
Fix Fixed kysely-adapter (better-auth): 1.7.16, 1.8.0-beta.5drizzle-adapter (better-auth): 1.7.16, 1.8.0-beta.5+1 more product

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
better-authkysely-adapter1.5.0-beta.9 to before 1.7.161.7.16Patch availableCNA
better-authkysely-adapter1.8.0-beta.0 to before 1.8.0-beta.51.8.0-beta.5Patch availableCNA
better-authdrizzle-adapter1.5.0-beta.9 to before 1.7.161.7.16Patch availableCNA
better-authdrizzle-adapter1.8.0-beta.0 to before 1.8.0-beta.51.8.0-beta.5Patch availableCNA
better-authbetter-authbefore 1.7.161.7.16Patch availableCNA
better-authbetter-auth1.8.0-beta.0 to before 1.8.0-beta.51.8.0-beta.5Patch availableCNA
  • kysely-adapter Vendorbetter-auth Affected 1.5.0-beta.9 to before 1.7.16 Fixed in 1.7.16 Patch available CNA
  • kysely-adapter Vendorbetter-auth Affected 1.8.0-beta.0 to before 1.8.0-beta.5 Fixed in 1.8.0-beta.5 Patch available CNA
  • drizzle-adapter Vendorbetter-auth Affected 1.5.0-beta.9 to before 1.7.16 Fixed in 1.7.16 Patch available CNA
  • drizzle-adapter Vendorbetter-auth Affected 1.8.0-beta.0 to before 1.8.0-beta.5 Fixed in 1.8.0-beta.5 Patch available CNA
  • better-auth Vendorbetter-auth Affected before 1.7.16 Fixed in 1.7.16 Patch available CNA
  • better-auth Vendorbetter-auth Affected 1.8.0-beta.0 to before 1.8.0-beta.5 Fixed in 1.8.0-beta.5 Patch available CNA

CPE names Threatist (inferred) · 1

Inferred from how NVD named this product before; not given by a source.

CPEVersionsRoleVendor
cpe:2.3:a:better-auth:better_auth:*:*:*:*:*:*:*:*——better-auth
  • cpe:2.3:a:better-auth:better_auth:*:*:*:*:*:*:*:* Versions — — ·better-auth

Remediation

Upgrade better-auth to 1.7.16 or 1.8.0-beta.5, and upgrade @better-auth/kysely-adapter and @better-auth/drizzle-adapter to 1.7.16 or 1.8.0-beta.5 to match the same release line. The sources list no advisory identifiers for these fixes.

Written with Claude Haiku 5.5 from the sources below · 2026-11-21

  • Fix · CNA kysely-adapter (better-auth) Fixed in 1.7.16
  • Fix · CNA kysely-adapter (better-auth) Fixed in 1.8.0-beta.5
  • Fix · CNA drizzle-adapter (better-auth) Fixed in 1.7.16
  • Fix · CNA drizzle-adapter (better-auth) Fixed in 1.8.0-beta.5
  • Fix · CNA better-auth (better-auth) Fixed in 1.7.16
  • Fix · CNA better-auth (better-auth) Fixed in 1.8.0-beta.5

Fixed in the same release

Records fixed by the same vendor advisory or release, as the CNA lists them.

  • Release ·

    better-auth 1.7.16, 1.8.0-beta.5

    8 records Highest priority Priority MEDIUM 1 MEDIUM, 7 LOW

    Other records, highest priority first

    • TI-2026-96321 Unverified phone numbers enable account takeover in better-authPriority MEDIUM 46
    • TI-2026-96312 Unverified OAuth emails enable account takeover in Better AuthPriority LOW 35
    • TI-2026-96311 Privilege escalation in better-auth admin update-user endpointPriority LOW 33

Timeline

  1. 2026-11-21 Threatist record created from CVE-2026-134313
  2. 2026-11-21 Alias added: GHSA-797g-cqxm-j7fj

References

  • TI-2025-38277 Better Auth: Unauthenticated API key creation through api-key plugin CVSS 4.0CRITICAL 9.3
  • TI-2026-47627 better-auth SCIM 1.5.0 before 1.7.0-beta.4 Authorization Bypass CVSS 4.0HIGH 8.7
  • TI-2025-20000 Beter Auth has an Open Redirect via Scheme-Less Callback Parameter CVSS 4.0MEDIUM 6.9
  • TI-2026-13066 better-auth better-icons scan_project_icons/sync_icon path traversal CVSS 4.0MEDIUM 4.8
  • TI-2026-79320 OAuth state accepted as Magic Link token in Better Auth CVSS 3.1CRITICAL 9.1
  • TI-2026-74552 Authentication bypass in Better Auth Magic Link verification CVSS 4.0CRITICAL 9.3
See all 50 →

Sources