Skip to main content

better-auth EUVDEUVD-2026-44732

| CVE-2026-53516 HIGH
Improper Authentication (CWE-287)
2026-07-07 https://github.com/better-auth/better-auth GHSA-g38m-r43w-p2q7
8.3
CVSS 3.1 · Vendor: https://github.com/better-auth/better-auth
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Learn victim email
  2. Delivery
    Pre-register email via /sign-up/email
  3. Exploit
    Attacker row saved emailVerified:false
  4. Install
    Victim performs first OAuth sign-in
  5. C2
    Callback email-fallback links OAuth to attacker row
  6. Execute
    Local emailVerified flipped to true
  7. Impact
    Attacker logs in with password, full takeover

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Authentication mechanism validation
MITRE ATT&CK

2 techniques across 2 tactics: Defense Evasion, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a better-auth deployment (< 1.6.11) with ALL of: emailAndPassword.enabled: true; at least one OAuth or SSO provider configured (built-in social, genericOAuth, or @better-auth/sso); account.accountLinking.disableImplicitLinking NOT set to true; and account.accountLinking.enabled NOT set to false - this is the default posture, so no non-default configuration is needed. The attacker must additionally know the victim's email address and pre-register it via /sign-up/email BEFORE the victim's account exists, and the victim must subsequently perform a first-time OAuth/SSO sign-in with that same email (the CVSS UI:R requirement). Limiting factors: the victim's OAuth provider must assert email_verified: true for the matching email; the attack fails if the victim already has an OAuth-linked account, if implicit linking is disabled, or once the target upgrades to 1.6.11 where requireLocalEmailVerified defaults to true. Note requireEmailVerification: true does NOT limit exploitation.

Impact

The supplied CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L, base 8.3, High) reflects a network-reachable, unauthenticated attack with full confidentiality and integrity impact, gated only by required victim interaction (the victim's later OAuth login). No EPSS score, KEV entry, POC, or SSVC decision data was provided, so exploitation-probability signals are absent rather than low - treat 'no public exploit identified' as unconfirmed-not-negative. The realistic risk is meaningfully constrained by preconditions the attacker does not fully control: the attacker must know the victim's email, pre-register it before the victim, and the victim must subsequently authenticate through OAuth/SSO to a still-vulnerable, default-configured deployment. This argues the practical complexity is higher than AC:L implies; I independently assess AC:H. Against that, the affected code path is default-on (email/password + any OAuth provider + implicit linking enabled by default) and the impact is persistent full account takeover, so for any app matching that configuration this is a genuine priority, not a high-CVSS paper cut. The named parallels (nOAuth, Sign in with Apple) show this class is exploited in the wild generally, even though this specific CVE has no confirmed active exploitation.

Exploit ScenarioDerived

An attacker calls /sign-up/email with the target victim's email address, creating a local user row with emailVerified: false and an attacker-known password. Later, the victim signs in for the first time via a configured OAuth provider (e.g. Google, Apple, or Microsoft); the callback finds no account match, falls back to email, and implicitly links the victim's verified OAuth identity onto the attacker's pre-existing row while flipping it to verified. The attacker now logs in with their own password to an account that also carries the victim's OAuth identity - persistent, full account takeover. No public POC was provided, but the technique mirrors the well-documented nOAuth and Sign in with Apple pre-hijacking attacks.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 07, 2026

Pre-account-hijacking in the better-auth Node/TypeScript authentication library (versions < 1.6.11 on the stable line and all current next pre-releases) lets an unauthenticated attacker seize a victim's account by pre-registering the victim's email via /sign-up/email, then having the victim's later OAuth/SSO sign-in implicitly linked to the attacker's row. The result is a single account the attacker controls with a working password login plus the victim's OAuth identity, and the link-time verification flip defeats requireEmailVerification: true. No public exploit identified at time of analysis; not listed in CISA KEV, though the flaw is the same class as Microsoft nOAuth (2023) and the Sign in with Apple JWT flaw (2020).

RemediationAI

Vendor-released patch: better-auth@1.6.11 - upgrade to 1.6.11 or later, which adds the local-side ownership check so implicit linking now refuses to attach an OAuth identity to a local account whose emailVerified is false, applies the same gate in the one-tap plugin, and normalizes Google's email_verified claim through toBoolean. The new gate is exposed as account.accountLinking.requireLocalEmailVerified (default true); apps whose users legitimately sign up via OAuth without ever verifying a local email can opt out with account: { accountLinking: { requireLocalEmailVerified: false } }, but this restores the vulnerable legacy behavior and is already marked deprecated, so avoid it. If you cannot upgrade immediately, set account.accountLinking.disableImplicitLinking: true to force all linking through the authenticated /link-social endpoint (side effect: users can no longer add a login method during an unauthenticated OAuth callback and must be signed in first), or set account.accountLinking.enabled: false to disable linking entirely (side effect: breaks the multi-login-method UX completely). Do not rely on emailAndPassword.requireEmailVerification: true - the link-time emailVerified flip promotes the attacker's row to verified and bypasses it. Advisory: https://github.com/better-auth/better-auth/security/advisories/GHSA-g38m-r43w-p2q7.

Affected VersionsENISA

better-auth < 1.6.11

Affected Packages

npm better-auth fix: 1.6.11

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

better-auth is a framework-agnostic authentication library distributed on npm (pkg:npm/better-auth) providing email/password, social OAuth, generic OAuth, and SSO (OIDC/SAML) flows. The defect lives in handleOAuthUserInfo, the shared OAuth-callback routine invoked by every social provider, genericOAuth, oauth-proxy, @better-auth/sso, and one-tap. When no (accountId, providerId) account match exists, user lookup falls back to matching on email, surfacing any pre-existing local row at that address. The auto-link gate then trusted only the OAuth provider's userInfo.emailVerified claim and never read the local user row's own emailVerified field - the root cause maps to CWE-287 (Improper Authentication) and closely to CWE-345 (Insufficient Verification of Data Authenticity). A separate, individually-correct post-link step promotes the local emailVerified to true when the provider asserts a matching verified email; combined with the missing local-side check, that promotion becomes load-bearing for the takeover. A related Google ID-token quirk - a string "false" for email_verified being treated as truthy - was also hardened via toBoolean normalization.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/better-auth/better-auth) PRIMARY 8.3 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L
vuln.today AI 6.8 MEDIUM

Network-reachable and unauthenticated (AV:N/PR:N), but AC:H because the attacker must win a pre-registration race and the victim must later OAuth-login (UI:R); full account takeover gives C:H/I:H, no availability impact (A:N).

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
4.0 AV:N/AC:H/AT:N/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/better-auth/better-auth).

CVSS VectorVendor: https://github.com/better-auth/better-auth

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
Low

DescriptionCVE.org

Am I affected?

Users are affected if all of the following are true:

  • Their application uses better-auth at a version < 1.6.11 on the stable line, or any current next pre-release.
  • emailAndPassword.enabled: true is set in their application's betterAuth({ ... }) configuration.
  • At least one OAuth or SSO provider is configured (any built-in social provider, or genericOAuth(...), or any provider via @better-auth/sso).
  • account.accountLinking.disableImplicitLinking is not set to true.
  • account.accountLinking.enabled is not set to false.

Setting either disableImplicitLinking: true or enabled: false closes the hole at the cost of breaking the standard "add another login method" UX. emailAndPassword.requireEmailVerification: true does not mitigate, because the link-time emailVerified flip promotes the attacker's row to verified, after which the password login becomes usable.

Fix:

  1. Upgrade to better-auth@1.6.11 or later.
  2. If developers cannot upgrade, see workarounds below.

Summary

The OAuth callback's auto-link gate in handleOAuthUserInfo admits an implicit account link whenever the provider asserts email_verified: true, without requiring the local user row's emailVerified to also be true. An attacker who pre-registers a victim's email through /sign-up/email (which writes a row with emailVerified: false) can have the victim's later OAuth identity bound to the attacker's user row, granting both a password login and the victim's OAuth identity on the same account. This is the pre-account-hijacking class - the same shape as Microsoft "nOAuth" (2023) and the Sign in with Apple JWT flaw (2020).

Details

The auto-link gate validates only the OAuth provider's userInfo.emailVerified claim. The local row's emailVerified field is never read. When no (accountId, providerId) match exists, the user lookup falls back to email, which surfaces any pre-registered row at that email.

A separate post-link step promotes the local emailVerified to true when the provider's claim is true and the local email matches the provider's email. This step is correct for legitimate first-time linking, but combined with the missing local-side check it becomes load-bearing for the takeover: after the link, the attacker's password row is treated as verified, defeating requireEmailVerification: true as a mitigation.

The fix adds the local-side ownership check to the gate: implicit linking now also rejects when dbUser.user.emailVerified is false. The same primitive lives in one-tap and inherits the same fix shape; the SSO domainVerified short-circuit follows separately as a hardening change.

Patches

Fixed in better-auth@1.6.11. Implicit linking now refuses to attach an OAuth identity to a local account whose emailVerified flag is false. The same gate change applies in the one-tap sign-in plugin, which previously had its own simpler linking path. The Google ID-token email_verified claim is also normalized through toBoolean so a string "false" is treated as falsy (some Google responses send the string, which the prior code treated as truthy).

The public surface for the new gate is account.accountLinking.requireLocalEmailVerified, defaulted to true. Applications whose users sign up through OAuth without ever verifying their email locally can opt out with account: { accountLinking: { requireLocalEmailVerified: false } } to retain the legacy permissive behavior. The option is marked @deprecated; the gate at each call site carries a FIXME pointing at the next-minor follow-up that drops the option and makes the check unconditional.

Test fixtures across the admin, oidc-provider, mcp, generic-oauth, last-login-method, and oauth-provider suites now pre-verify created users via a databaseHooks.user.create.before hook (or the disableTestUser opt-in on the oauth-provider RP fixture) so those suites continue to exercise their role and flow logic rather than tripping the new gate.

Workarounds

If developers cannot upgrade their applications immediately:

  • Disable implicit linking: set account.accountLinking.disableImplicitLinking: true. Forces all linking through the authenticated /link-social endpoint where the user must already be signed in.
  • Disable linking entirely: set account.accountLinking.enabled: false. Closes the hole but breaks the multi-login-method UX entirely.

emailAndPassword.requireEmailVerification: true alone does not mitigate, because the link-time emailVerified flip promotes the attacker's row to verified.

Impact

  • Account takeover via pre-account hijacking: the attacker holds a working password login plus the victim's OAuth identity on the same account, granting persistent access.
  • requireEmailVerification: true bypass: the attacker's password login becomes usable post-link.
  • Cross-flow reach: every OAuth and SSO sign-in path that calls handleOAuthUserInfo is affected (built-in social providers, generic-oauth, oauth-proxy, SSO OIDC, SSO SAML, one-tap).

Credit

Reported by @avrmeduard.

Resources

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 34 npm packages depend on better-auth (20 direct, 14 indirect)

Ecosystem-wide dependent count for version 1.6.11.

Executive ViewAI

Why It Matters

better-auth (Node/TypeScript authentication library) in versions below 1.6.11 and current pre-releases allows unauthenticated attackers to hijack user accounts by pre-registering victim email addresses and exploiting implicit OAuth linking. Organizations using vulnerable better-auth versions face immediate risk of complete account compromise, enabling attackers to access user data and systems with both password and OAuth credentials.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable /sign-up/email endpoint to prevent attacker pre-registration; (2) Require email verification confirmation before OAuth linking, independent of requireEmailVerification configuration; (3) Deploy multi-factor authentication (MFA) for user authentication; (4) Add manual approval workflow for new account-linking requests; (5) Monitor and alert on account-linking activities; (6) Consider temporary suspension of self-service registration if organizational risk tolerance is low.

Threat Intelligence Overview

EPSS Score
0.2%
Top 85% exploitable
Prevalence
Medium
popular modern TypeScript/npm auth framework, growing but not ubiquitous adoption
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy