Intel

AIKIDO-2026-198254

@better-auth/kysely-adapter is vulnerable to Race Condition (TOCTOU)

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 4 days ago
November 5, 2026

59

CVE Score

Medium

Race Condition (TOCTOU)

Are you affected? Scan for Free

TL;DR

The Kysely adapter's guarded delete and update paths select matching row IDs under the caller supplied guard condition, then write to those IDs without re-checking the guard. A concurrent write to the same row between the select and the write can change which rows still match the guard, so the write runs against the now stale IDs and bypasses the condition it was meant to enforce. The fix re-applies the guard to the final delete and update query so it is checked again against the row's current state.

How do I fix this?

Upgrade the @better-auth/kysely-adapter library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and concurrent requests can modify the same guarded record through the Kysely adapter.

Versions

0.0.1 - 1.7.6

Fixed in 1.7.7

Background info

@better-auth/kysely-adapter is vulnerable to Race Condition (TOCTOU) in versions 0.0.1 - 1.7.6.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea