CVE-2024-56734: Better Auth has an Open Redirect Vulnerability in Verify Email Endpoint

Published Dec 30, 2024
·
Updated

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:

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 } } } })

Other sources

Better Auth is an authentication library for TypeScript. An open redirect vulnerability has been identified in the verify email endpoint of all versions of Better Auth prior to v1.1.6, 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. Version 1.1.6 contains a patch for the issue.

MITRE

Affected Software

2 affected componentsFixes available
npm/better-auth<1.1.6
1.1.6
better-auth Better Auth Node.js<1.1.6

Event History

Dec 30, 2024
CVE Published
via MITRE·04:48 PM
Data Sourced
via MITRE·04:48 PM
DescriptionWeakness
Advisory Published
via GitHub·04:49 PM
Data Sourced
via NVD·05:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:15 PM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-56734?

CVE-2024-56734 has a severity rating that allows attackers to potentially redirect users to malicious websites.

2

How do I fix CVE-2024-56734?

To resolve CVE-2024-56734, upgrade to version 1.1.6 or higher of the Better Auth package.

3

What kind of vulnerability is CVE-2024-56734?

CVE-2024-56734 is classified as an open redirect vulnerability affecting the verify email endpoint.

4

Who is affected by CVE-2024-56734?

CVE-2024-56734 affects users relying on email verification links generated by the Better Auth library.

5

What can attackers achieve with CVE-2024-56734?

Attackers can exploit CVE-2024-56734 to redirect users to potentially harmful or malicious websites.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203