The adapter inserts a row, then reads its new ID in a separate query. A connection pool may send that second query to another connection, associating the first request with another request's row.Better Auth says an ordinary concurrent sign-in can give a user another user's session and let them act as that user. Sign-up can also return another user's record; some requests instead fail. The attacker cannot choose the account received.
What it allows
How Can CVE-2026-134313 Mix Up Sessions?
Better Auth says the MySQL branch inserted a row through a connection pool and fetched its serial ID separately. MySQL's inserted-ID value belongs to one connection. If the second query reaches another pooled connection, the adapter can associate the request with another request's inserted record.
The sign-in outcome can cross an account boundary without the attacker choosing a target account. Review unexpected account changes reported during sign-in and sign-up, and correlate them with application authentication logs. This is our investigation guidance based on the vendor's impact description, not a published detection signature.
Prioritize applications with concurrent authentication traffic and the required database setting. Use the Vulnerability Intelligence platform as product context for organizing the affected application inventory. The exposure depends on the configuration and adapter, not simply on a package name.
Who is affected
Which CVE-2026-134313 Versions and Configurations Are Affected?
Better Auth lists better-auth versions before 1.7.16 and beta versions 1.8.0-beta.0 through versions before 1.8.0-beta.5. For @better-auth/kysely-adapter and @better-auth/drizzle-adapter, the first affected range starts at 1.5.0-beta.9 and ends before 1.7.16. Both adapters also have the same 1.8.0 beta range.
All three conditions must hold: MySQL or MariaDB, advanced.database.generateId set to serial, and the default Kysely adapter or pooled Drizzle adapter. Better Auth says other databases and other ID settings are not affected. Inventory the installed core and adapter versions together, then check the application's database and ID configuration.
The vendor's better-auth stable range has no lower version boundary, so this page does not offer an automatic version comparison. Assess that package against the documented range manually. Record installed and running versions in your patch management process; the vulnerability intelligence glossary explains how to place this finding in broader triage.
Timeline
-
2026-11-03
Better Auth published GHSA-48c2-w96j-mv3m with affected packages, conditions, fixes, and a workaround.
-
2026-11-21
NVD published the CVE-2026-134313 record.
What to do
-
Identify exposed applications
Record the installed better-auth and adapter versions, MySQL or MariaDB use, serial ID setting, and connection pool configuration. Confirm each condition before labeling an application affected.
-
Upgrade the core and adapter
Update better-auth and the installed Kysely or Drizzle adapter to 1.7.16 on the stable line, or 1.8.0-beta.5 on the beta line. Follow the vendor's advisory for package scope.
-
Verify the running versions
After deployment, confirm the application actually runs the fixed better-auth and adapter package versions. Check the dependency lockfile and deployed runtime rather than assuming an install command changed production.
-
Apply the vendor workaround if an upgrade must wait
Stop using generateId: serial on MySQL until the upgrade is complete. Better Auth says a single-connection pool does not prevent the issue; validate any configuration change in the application before rollout.
What Brandefense can do
- Watch your stack for exploited flaws
Name the vendors and products you run, and Brandefense alerts you when a CVE in them is exploited.
- See CVE-2026-134313 in Brandefense Atlas
The Atlas record of CVE-2026-134313: severity, exploitation status and the sources behind it.
- Vulnerability intelligence platform
Brandefense Vulnerability Intelligence follows which vulnerabilities attackers are using, so your team can patch what is under attack first.
Frequently Asked Questions
Does CVE-2026-134313 affect every Better Auth deployment?
No. Better Auth requires MySQL or MariaDB, serial ID generation, and the specified Kysely or pooled Drizzle adapter configuration. Check all three conditions and the installed versions.
Can an attacker choose whose session they receive?
Better Auth says they cannot choose the account. Under concurrent load, a sign-in may receive another user's session, while other requests may fail.
Does a single database connection remove the risk?
No. Better Auth explicitly says a single-connection pool does not prevent this issue. Upgrade both the core and adapter packages, or stop using serial ID generation on MySQL temporarily.
Which releases contain the fix?
Better Auth names 1.7.16 for the stable line and 1.8.0-beta.5 for the beta line. Apply the matching core and adapter package updates, then verify their running versions.
Sources
- MySQL Serial IDs Can Return Another Request's RecordBetter Auth
- CVE-2026-134313 DetailNIST NVD