/

CVE-2026-53516

Severity:

HIGH RISK

(8.3)

OAuth Account Linking Flaw (CWE-287) in Better Auth

CVE-2026-53516

Analyzed

Vulnerability type

Category:

Authentication and Authorization Flaw

CWE:

CWE-287, CWE-345

Impact:

Account Takeover via Improper OAuth Account Linking

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Better Auth's OAuth callback logic can implicitly link an OAuth identity to a local account based solely on the provider's email_verified claim, without confirming the local account's own email verification status.

If an attacker pre-registers a victim's email address, they may be able to bind the victim's OAuth identity to the attacker-controlled account during login or one-tap flows.

Affected context

This vulnerability appears in Better Auth deployments that:

  • Use OAuth providers with email_verified claims and rely on auto-linking behavior
  • Allow sign-up via /sign-up/email or similar email-based registration flows
  • Enable one-tap or flows where the library decides account linking automatically

The issue manifests when the library trusts the OAuth provider's email_verified: true assertion as sufficient proof to link identities, regardless of whether the corresponding local user record has emailVerified set.

Exploit preconditions

  • Attack surface: Public authentication endpoints relying on Better Auth's OAuth callback and one-tap flows.
  • Required access: Ability to initiate OAuth sign-in flows and to pre-register email addresses using the normal sign-up endpoint.
  • Trigger point: The OAuth callback handler (handleOAuthUserInfo) performing auto-linking based on the provider's email_verified claim.
  • Why exploitation is possible: The account-linking logic treats the provider's email_verified flag as sufficient evidence of identity, without enforcing a matching verification state on the local user row, enabling a pre-registered email to be linked to an attacker-controlled account.

Why this happens

The root cause is an authentication and identity-proofing flaw where external OAuth assertions are over-trusted.

Specifically, the account linking gate accepts email_verified: true from the OAuth provider as a decisive signal for identity equivalence, without requiring a consistent verification state on the local user object.

This falls under CWE-287 (Improper Authentication) and CWE-345 (Insufficient Verification of Data Authenticity), as the system fails to rigorously validate that the authenticated OAuth identity corresponds to a fully verified local account before allowing linkage.

Abstractly, the insecure pattern is "implicit account linking based on third-party claims without enforcing local verification and consistent identity ownership checks."

Potential impact

  • An attacker may bind a victim's OAuth identity to an attacker-controlled local account.
  • Users could experience partial or full account takeover in applications relying on Better Auth for OAuth login.
  • Sensitive data associated with the victim's account may be exposed to the attacker.
  • Downstream actions performed via the compromised session could affect authorization, billing, or stored user consents.

General mitigation guidance

Effective mitigation focuses on tightening identity linking rules and reducing implicit trust in third-party assertions:

  • Require both sides of the link to meet strict verification criteria (for example, the local user's email must be verified before any OAuth-based linking is accepted).
  • Treat OAuth provider email_verified as one signal among many, not as a sole authority, and consider additional checks such as explicit user confirmation or secure out-of-band verification.
  • Implement explicit, user-driven account linking flows instead of silent or automatic linking, ensuring the active, authenticated user approves the connection.
  • Enforce clear separation between "account creation", "email verification", and "identity linking" steps to avoid hidden coupling that bypasses verification.
  • Design authentication logic using least-privilege principles, granting minimal linkage rights to newly created or unverified accounts.

How teams detect issues like this

To detect similar vulnerabilities, teams can:

  • Review authentication and OAuth integration code for any auto-link or "magic" linking paths that depend solely on provider claims like email_verified.
  • Use static analysis or policy checks to flag code paths where external identity assertions are trusted without cross-checking against local verification flags.
  • Incorporate security-focused code review checklists that explicitly ask how identities are linked across providers and what verification barriers exist.
  • Examine audit logs for suspicious patterns, such as multiple distinct logins or devices associating with the same email or OAuth identity shortly after account creation.

Sources

SourceLink
github.comgithub.com/better-auth/better-auth/commit/da7e50beee849c59a2ed1ec6b3a38cc6ab9fb563
github.comgithub.com/better-auth/better-auth/pull/9578
github.comgithub.com/better-auth/better-auth/releases/tag/v1.6.11
github.comgithub.com/better-auth/better-auth/security/advisories/GHSA-g38m-r43w-p2q7

Frequently asked

questions

Exploitation is limited to scenarios where an attacker can pre-register a victim's email and then complete an OAuth flow that the application auto-links; in such configurations, the issue can be exploited remotely over standard authentication endpoints.

No special privileges are required beyond what a normal user has: the attacker needs the ability to sign up with an email address and initiate OAuth sign-ins with a provider that asserts email_verified: true.

The safest pattern is to require explicit, verified ownership of both accounts before linking: ensure the local user's email is verified, do not auto-link solely on provider claims, and ideally require an explicit user-driven confirmation step when connecting OAuth identities.

Establish clear design rules for identity federation: never rely on a single external claim to prove identity, enforce local verification state, add explicit linking flows, and incorporate security reviews for all authentication and OAuth-related changes.

Find out what's already
exploitable in your codebase.