CVE-2024-56734
mediumpriority · track · 24EPSS 0.004 · 33 %ileEUUSEPSS · scored 2026-10-27
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.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 5–7.9
ssvc
A stakeholder decision — act, attend, or track — from exploitation and impact.
weaknesses
The CWE weakness classes this flaw belongs to.
affected products (3)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-8jhw-6pjj-8723Better Auth has an Open Redirect Vulnerability in Verify Email Endpoint2024-12-30ghsa · osvUS
## 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 } } } }) ```
also known as (3)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (7)
External citations — patches, advisories, analysis.
- https://github.com/better-auth/better-auth/commit/deb3d73aea90d0468d92723f4511542b593e522fcnnvd
- https://github.com/better-auth/better-auth/releases/tag/v1.1.6Patchcnnvd
- https://github.com/better-auth/better-auth/security/advisories/GHSA-8jhw-6pjj-8723cnnvd
- https://github.com/better-auth/better-auth/commit/deb3d73aea90d0468d92723f4511542b593e522fenisa_euvd
- https://github.com/better-auth/better-auth/security/advisories/GHSA-8jhw-6pjj-8723enisa_euvd
- https://github.com/better-auth/better-auth/commit/deb3d73aea90d0468d92723f4511542b593e522fPatchnvd
- https://github.com/better-auth/better-auth/security/advisories/GHSA-8jhw-6pjj-8723ExploitMitigationVendor Advisorynvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan