GHSA-HWQ2-V29R-P69R
better-auth: Email-change links stay valid after the address changes hands
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-HWQ2-V29R-P69R divulgada · CVSS 6.4 (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 |
Am I affected?
You are affected if you use `better-auth` 1.4.0 or later with all of these:
- `user.changeEmail.enabled` is turned on.
- `emailVerification.sendVerificationEmail` is configured.
- A new user can register an address after its previous owner moves to another one.
Summary
An email change link recorded the old and new addresses, but not the user who asked for the change. If someone else registered the old address while the link was still valid, opening the link acted on that person's account.
Impact
A user who controls the addresses involved can take over an account that later registers their released old address, using a link issued for their own account. They get a session for that account, and its email changes to an address they control. The attack needs the victim to register the released address while one of the attacker's links is still valid.
Patches
Upgrade `better-auth` to 1.7.16, or to 1.8.0-beta.5 on the beta line.
Email verification and change links now work only for the account they were issued to. Opening a change link no longer signs the user in, and it marks the new address verified only if the current one was verified.
Workarounds
Turn off user-initiated email changes until you upgrade. A lower `emailVerification.expiresIn` shortens the window but does not stop the attack.
Technical details
The change link carried the old and new addresses. Without a session, Better Auth looked up the account that owned the old address at that moment, created a session for it, and changed its email. The link now carries the requesting user's ID and is rejected for any other account.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde 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 |
1.7.161.8.0-beta.5Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/better-auth/better-auth/security/advisories/GHSA-hwq2-v29r-p69rLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
