CVE-2024-56734: Better Auth has an Open Redirect Vulnerability in Verify Email Endpoint
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.
Published Dec 30, 2024
Affected packages
better-auth
- Ecosystem
- npm
- Affected
- < 1.1.6
- Fixed in
- 1.1.6
- Check
npm ls better-auth
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.comPatches
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
}
}
}
})Credited to jamesjulich.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-114607
better-auth: OAuth state can be used as a Magic Link to sign in as another user
critical9.1Oct 27, 2026GHSA-44jh-23m7-hpcf
@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL
low3.7Oct 27, 2026GHSA-q84f-53jg-9ppm
better-auth: Device login approval does not show the requesting client or permissions
high8.1Oct 27, 2026GHSA-r4xp-prcw-77qf
better-auth: OAuth Proxy lets an attacker sign in as another user
high7.4Oct 27, 2026GHSA-qq9h-g4jm-xgf3
Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in
high8.3Jul 24, 2026CVE-2026-53512
Better Auth: OAuth refresh-token replay via missing client authentication on oidc-provider and mcp plugins
critical9.1Jul 7, 2026
