better-auth email-change link account takeover (CVE-2026-134315)
better-auth versions 1.4.0 before 1.7.16 and 1.8.0-beta.0 before 1.8.0-beta.5 contain an improper authentication vulnerability in email-change links. The link records old and new addresses but not the requesting user, allowing an attacker to reuse a still-valid link after a victim registers the attacker's released old address, gaining a session and changing the victim's email to one the attacker controls.
Overview
CVE-2026-134315 affects better-auth, a Node.js/JS authentication library. The vulnerability exists in email-change link handling: the link does not bind to the requesting user, only to the old and new email addresses. If an attacker initiates an email change for their own account, then releases the old address, and a victim later registers that same old address, the attacker can open the still-valid link. This grants the attacker a session and changes the victim's email to an attacker-controlled address, leading to account takeover.
Affected versions: - 1.4.0 through 1.7.15 (fixed in 1.7.16) - 1.8.0-beta.0 through 1.8.0-beta.4 (fixed in 1.8.0-beta.5)
What to do
1. Upgrade better-auth to a fixed version: 1.7.16 or later (stable), or 1.8.0-beta.5 or later (beta). Verify the exact version in your package manifest and apply the update. 2. Review the vendor advisory at https://github.com/better-auth/better-auth/security/advisories/GHSA-hwq2-v29r-p69r for any additional mitigation steps or configuration changes. 3. Invalidate existing email-change links after upgrading. If your application stores or caches such links, ensure they are cleared or expired immediately. 4. Audit recent email-change activity for signs of abuse, especially any changes where the old address was previously used by another account. 5. Consider adding a user identifier to email-change links as a defense-in-depth measure, if you cannot upgrade immediately (but upgrading is the primary fix). 6. Monitor NVD and vendor channels for further updates or exploit activity, as this vulnerability may be targeted.