Skip to content

CVE-2026-134313 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

HighCVSS 7.6 EPSS 0.35%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: total
Technology
MySQLMariaDB

Description

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.

Upgrade path

3 packages: 3 fixed.

PackageAffectedFixed inStatus
better-auth @better-auth/drizzle-adapter >= 1.5.0-beta.9, < 1.7.16; >= 1.8.0-beta.0, < 1.8.0-beta.5 1.7.16, 1.8.0-beta.5 Fixed
better-auth @better-auth/kysely-adapter >= 1.5.0-beta.9, < 1.7.16; >= 1.8.0-beta.0, < 1.8.0-beta.5 1.7.16, 1.8.0-beta.5 Fixed
npm better-auth < 1.7.16; >= 1.8.0-beta.0, < 1.8.0-beta.5 1.7.16, 1.8.0-beta.5 Fixed

Affected products

ProductAffected versionsFixed in
better-auth @better-auth/kysely-adapter >= 1.5.0-beta.9, < 1.7.16 1.7.16
better-auth @better-auth/kysely-adapter >= 1.8.0-beta.0, < 1.8.0-beta.5 1.8.0-beta.5
better-auth @better-auth/drizzle-adapter >= 1.5.0-beta.9, < 1.7.16 1.7.16
better-auth @better-auth/drizzle-adapter >= 1.8.0-beta.0, < 1.8.0-beta.5 1.8.0-beta.5
npm better-auth < 1.7.16 1.7.16
npm better-auth >= 1.8.0-beta.0, < 1.8.0-beta.5 1.8.0-beta.5

References