Intel

AIKIDO-2026-187399

better-auth is vulnerable to Authentication Bypass

GHSA-2f9c-7xj7-gh55Published Nov 4, 2026
November 4, 2026

48

CVE Score

Medium

Authentication Bypass

Are you affected? Scan for Free

TL;DR

The emailOTP() plugin in better-auth has three weaknesses. First, the OTP attempt counter was read and written in separate steps, so concurrent guesses could be counted as a single attempt and an attacker could exceed allowedAttempts to brute-force an active OTP and sign in or reset a password. Second, email change codes were stored under a key built from both addresses, so different address pairs could collide and a code requested from one account could be used from another, letting a signed-in user mark an address they do not own as verified. Third, on databases with accent-insensitive collation (common on MySQL), a lookup by email could return an account whose stored address differs only by accents, and password reset sent the code to the requested address instead of the account's own, allowing password reset for the victim account. The fix counts every guess against the limit, binds email change codes to the requesting account and new address, and only returns users whose stored address matches the requested one (case-insensitive).

How do I fix this?

Upgrade the better-auth library to the patch version. Email change codes sent before the upgrade must be requested again. As a workaround, disable email change in the email OTP plugin (the default) and use the core email change flow instead; lowering allowedAttempts and the OTP lifetime reduces, but does not fix, the attempt limit issue.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and use the emailOTP() plugin. The attempt limit issue affects any email OTP flow. The email change code issue additionally requires changeEmail.enabled: true in the plugin (version 1.5.0 or later). The accented address issue additionally requires a database collation that ignores accents, which is common on MySQL.

Versions

1.3.7 - 1.7.15

Fixed in 1.7.16

Background info

better-auth is vulnerable to Authentication Bypass in versions 1.3.7 - 1.7.15.

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