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

GHSA-8JHW-6PJJ-8723

Better Auth has an Open Redirect Vulnerability in Verify Email Endpoint

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición690 dDesde la divulgación, 30 dic 2024, 11:49 a. m.
Detección686 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Parche 1.1.6
Monitoreo
Detectada
30 dic 24
4 feb 26
17 nov 26
20 nov 26
30 dic 24
21 jun 25
10 dic 25
1 jun 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-8JHW-6PJJ-8723 divulgada
Remediación Parche 1.1.6 better-auth · 0 d desde divulgación
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

## Summary
An open redirect vulnerability has been identified in the verify email endpoint of Better Auth, potentially allowing attackers to redirect users to malicious websites. This issue affects users relying on email verification links generated by the library.

## Affected Versions
- All versions prior to v1.1.6.

## Impact
Attackers could craft malicious email verification links that exploit the redirect functionality to send users to untrusted domains. This can result in:

  • Phishing attacks – Users may unknowingly enter sensitive information on fake login pages.
  • Reputation damage – Trust issues for applications using Better Auth.

## Vulnerability Details
The verify email callback endpoint accepts a `callbackURL` parameter. Unlike other verification methods, email verification only uses JWT to verify and redirect without proper validation of the target domain. The origin checker is bypassed in this scenario because it only checks for `POST` requests. An attacker can manipulate this parameter to redirect users to arbitrary URLs controlled by the attacker.

Example Exploit:

https://example.com/auth/verify-email?token=abcd1234&callbackURL=https://malicious-site.com

## Patches
Upgrade to Better Auth v1.1.6 or later. This version enforces domain validation for `callbackURL` for `/verify-email` path and for all other `GET` endpoints.

## Workarounds
You can also use hooks to pre-check URLs in your auth instance to prevent this without upgrading:

const auth = betterAuth({
    hooks: {
         before: (ctx) => {
            if (ctx.path === "/verify-email") {
               const callbackURL = ctx.query.callbackURL; // Check if this is a trusted callback URL or not
            }
         }
    }
})

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida Última
better-auth< 1.1.6
1.1.6
1.7.26
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmbetter-auth
Corregida 1.1.6 0 d 1.7.26 no afectada
Versiones corregidas1.1.6
Explotación

Arsenal público

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

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2024-56734
Otrahttps://github.com/better-auth/better-auth/security/advisories/GHSA-8jhw-6pjj-8723
Otrahttps://github.com/better-auth/better-auth/commit/deb3d73aea90d0468d92723f4511542b593e522f
Otrahttps://github.com/better-auth/better-auth

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