llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · better-auth

GHSA-2F9C-7XJ7-GH55

better-auth: Email OTP attempt limit can be raced and codes are loosely bound to addresses

Parche disponible
Descargar PNG JSON
CVSS 3.1
4.8
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versionesPrimer parche el mismo día de la divulgación
Exposición17 dDesde la divulgación, 3 nov 2026, 4:38 p. m.
Detección14 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 1.7.16 +1
Monitoreo
Detectada +1
3 nov 26
18 nov 26
20 nov 26
3 nov 26
8 nov 26
12 nov 26
16 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-2F9C-7XJ7-GH55 divulgada · CVSS 4.8 (GitHub)
Remediación Parche 1.7.16 better-auth · 0 d desde divulgación
Remediación Parche 1.8.0-beta.5 better-auth · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Am I affected?

You are affected if you use the `emailOTP()` plugin from `better-auth` 1.3.7 or later. Each problem below adds its own condition:

  • Attempt limit: any email OTP flow.
  • Email change codes: `changeEmail.enabled: true` in the plugin, from 1.5.0.
  • Accented addresses: a database collation that ignores accents, common on MySQL.

Summary

Attempt limit. Guesses that arrive at the same time could be counted as one attempt, so an attacker could make more guesses than `allowedAttempts` allows.

Email change codes. Codes for changing an email address were stored under a key built from both addresses. Two different address pairs could produce the same key, so a code requested from one account could be used from another.

Accented addresses. On databases that ignore accents, a lookup for an address could return an account with a different stored address. Password reset then sent the code to the requested address, not the account's own.

Impact

With the attempt limit problem, an unauthenticated attacker can make extra guesses against an active OTP and, if a guess hits, sign in or reset the password.

With the email change problem, a signed-in user can mark an unused address on their own account as verified. The real owner of that address may later be signed in to the attacker's account.

With the accented address problem, an attacker who receives mail at an address that differs from the victim's only by accents can reset the victim's password, with no action from the victim.

Patches

Upgrade `better-auth` to 1.7.16, or to 1.8.0-beta.5 on the beta line. Email change codes sent before the upgrade must be requested again.

Workarounds

Turn off email change in the email OTP plugin, which is the default, and use the core email change flow instead. Lowering `allowedAttempts` and the OTP lifetime reduces the attempt limit problem but does not fix it.

Technical details

The attempt counter was read and written in separate steps, so concurrent checks could each see the same count. Every guess now counts against the limit, and a correct check still leaves the OTP usable for the follow-up call. Email change codes are now bound to the requesting account and the new address. Looking up a user by email now returns an account only when its stored address matches the requested one, ignoring case, and the reset routes send the code to the address on the account.

Credit

The accented address problem was discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-Y7X5RTID.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:L
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
better-auth≥ 1.3.7 < 1.7.16
better-auth≥ 1.8.0-beta.0 < 1.8.0-beta.5
1.3.7
1.7.16
1.7.26
1.8.0-beta.0
1.8.0-beta.5
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmbetter-auth
Corregida 1.7.16, 1.8.0-beta.5 0 d · 0 d 1.7.26 no afectada
Versiones corregidas1.7.161.8.0-beta.5
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/better-auth/better-auth/security/advisories/GHSA-2f9c-7xj7-gh55

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.