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
NIST has received this entry but not started reviewing it.
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.
Concurrent Execution using Shared Resource with Improper Synchronization CWE-362
Two things happening at nearly the same time can be made to go wrong in a way the attacker controls.
The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.
Weakness data: MITRE Common Weakness Enumeration.
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable, 6 products in all. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Better-auth Kysely-adapter | Software | from 1.5.0-beta.9, before 1.7.16 | 1.7.16 |
| Better-auth Kysely-adapter | Software | from 1.8.0-beta.0, before 1.8.0-beta.5 | 1.8.0-beta.5 |
| Better-auth Better-auth | Software | from 0, before 1.7.16 | 1.7.16 |
| Better-auth Better-auth | Software | from 1.8.0-beta.0, before 1.8.0-beta.5 | 1.8.0-beta.5 |
| Better-auth Drizzle-adapter | Software | from 1.5.0-beta.9, before 1.7.16 | 1.7.16 |
| Better-auth Drizzle-adapter | Software | from 1.8.0-beta.0, before 1.8.0-beta.5 | 1.8.0-beta.5 |
The 7.6 severity score (high) from vulncheck.com, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | Network | Can be attacked from anywhere on the internet, with no need to be near the target. |
| How hard it is | High | Hard to carry out. It depends on conditions the attacker cannot control. |
| Setup needed on the target | Present | The target has to be set up in a particular way. |
| Login needed | Low | The attacker needs an ordinary user account. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Data exposed | High | Total loss of confidentiality: the attacker can read all the data the program can reach. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | None | The service keeps running. |
Scorers can disagree. NIST scores every flaw the same way; the reporting company knows its own product best.
NIST lists 2 sources for this flaw, none tagged as a vendor patch.