Executive brief
Better Auth is a security library used by developers to handle user logins and permissions in TypeScript applications. A flaw in how it links social media accounts (like Google or GitHub) to local user accounts allows an attacker to take over a victim's account. By pre-registering a victim's email address, an attacker can force the victim's legitimate social login to link to the attacker's account, granting the attacker full access to the victim's data and identity within the application.
Technical details
An authentication bypass and account takeover vulnerability exists in Better Auth's OAuth implementation. The `handleOAuthUserInfo` function, used by social providers and SSO, implicitly links incoming OAuth identities to existing local user rows based on email matching if the IdP asserts `email_verified: true`. However, it fails to check if the local user row itself is verified. An attacker can exploit this by pre-registering a victim's email via `/sign-up/email` (which creates an unverified row). When the victim later signs in via OAuth, the library links the victim's verified IdP identity to the attacker-controlled local row. This issue is fixed in version 1.6.11 by requiring `dbUser.user.emailVerified === true` for implicit linking.
Affected products
- better-auth better-auth < 1.6.11
Timeline
- 2026-05-12: patched: Fix merged in PR #9578 and released in v1.6.11
- 2026-07-15: advisory: CVE-2026-53516 published via GitHub and NVD