Home
Trends
Vulnerabilities
News
Researchers
Why dbugs?

Jamesjulich

#31910of 53,630
7.9Total CVSS
Vulnerabilities · 1
PT-2024-37047
7.9
2024-12-30
Unknown · Better Auth · CVE-2024-56734
**Name of the Vulnerable Software and Affected Versions** Better Auth versions prior to v1.1.6 **Description** 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. 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. **Recommendations** For versions prior to v1.1.6, upgrade to Better Auth v1.1.6 or later, which enforces domain validation for `callbackURL` for the `/verify-email` path and for all other `GET` endpoints. As a temporary workaround, consider using hooks to pre-check URLs in your auth instance to prevent this without upgrading. For example: ```ts 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 } } } }) ```