Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIdentify target email before victim's first login
-
DeliveryRegister account using victim's email with attacker-chosen password
-
ExploitAccount sits unverified, attacker cannot yet log in
-
InstallVictim signs in via magic-link or email-OTP
-
C2Library verifies account without removing attacker's password or revoking sessions
-
ExecuteAttacker logs in with planted credentials
-
ImpactMaintains persistent access to victim's account
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 | All three of the following conditions must hold simultaneously for exploitation to be possible: (1) the application runs better-auth >= 1.1.3 and < 1.6.22 on the stable line, or >= 1.7.0-beta.0 and < 1.7.0-beta.10 on the pre-release line; (2) either the magic-link plugin or the email-OTP plugin is enabled and exposed to users; (3) open email/password registration is enabled, allowing an attacker to register an arbitrary email address without prior ownership verification. Exploitation is additionally bounded by a timing constraint: the attacker must complete registration with the victim's email before the victim's first successful passwordless authentication - once the legitimate owner has signed in via the passwordless flow even once under the patched code path, the pre-hijack opportunity is permanently closed. The UI:P in the CVSS 4.0 vector reflects that the victim's action (their first passwordless login) is a required step in completing the attack. Applications that enforce email verification before accepting any password, or that disable open registration (invite-only flows), significantly reduce exposure but do not fully eliminate it per the vendor advisory. |
| Impact | The CVSS 4.0 score of 8.7 (AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L) reflects a serious but user-interaction-dependent vulnerability: the attacker can position the trap remotely with no privileges, but the victim must perform a passwordless login to trigger account verification and complete the attack. VC:H/VI:H indicate full confidentiality and integrity compromise of the victim's account. No EPSS data was provided, so exploitation probability cannot be quantified numerically. This CVE does not appear in the CISA KEV catalog and no public POC has been identified at time of analysis. Despite the absence of known active exploitation, real-world risk should be considered elevated for any application meeting all three prerequisite conditions simultaneously (open registration + magic-link or OTP plugin + no prior email verification enforcement). The attack window is bounded by timing - it closes once the legitimate owner completes their first passwordless login - but many applications have long-dormant accounts or onboard users slowly, extending this window significantly. The attack requires no special technical skill beyond knowing the target's email address and being able to register on the application. |
| Exploit ScenarioDerived | An attacker learns the email address of a target who has not yet registered on the application (e.g., a newly invited user). Before the target's first login, the attacker visits the registration page and creates an account using the target's email and a password of their choosing; the account remains in an unverified state. When the target receives their invitation and signs in via a magic-link or email-OTP, the better-auth library marks the account verified and issues the target a valid session - but the attacker's password hash is still in the database and all pre-existing sessions remain active. The attacker then logs in normally with the planted credentials and has full, persistent access to the victim's account. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 01, 2026
Pre-account hijacking in better-auth (npm) allows a remote attacker to gain persistent, password-based access to any victim account on applications that combine open email/password registration with the magic-link or email-OTP passwordless plugins. The attacker plants a password on the victim's email address before the legitimate owner ever signs in; when the owner later authenticates via the passwordless flow, the library verifies the account without clearing the pre-existing password or revoking pre-existing sessions, leaving the attacker's credentials valid. No public exploit identified at time of analysis, but the attack is mechanically trivial and requires only the ability to register an account - no special tooling, credentials, or network position needed.
RemediationAI
Upgrade to better-auth 1.6.22 or later on the stable npm release line, or to 1.7.0-beta.10 or later on the pre-release line; both versions are confirmed fixed by the vendor advisory GHSA-qq9h-g4jm-xgf3, with the fix implemented in PR #10239 (commit c06a56d83a40bbaeac12d3a8b8b67e59f92a9110). If an immediate upgrade is not possible, two partial mitigations can reduce but not eliminate risk: first, configure the application to require email verification before accepting a password on any account, which adds a barrier that slows the attack setup; second, implement aggressive purging of unverified accounts to shrink the window during which a pre-planted account can sit waiting. Both workarounds reduce the attack surface but do not close the vulnerability, as the vendor advisory explicitly states. Neither mitigation addresses the core flaw - that verification does not revoke prior credentials - so upgrading remains the only complete remediation.
Affected VersionsENISA
Affected Packages
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 Node.js authentication framework distributed via npm (CPE: cpe:2.3:a:better-auth:better-auth). It provides modular plugins for various authentication flows, including magic-link and email-OTP passwordless sign-in alongside traditional email/password registration. The root cause is CWE-287 (Improper Authentication): when either passwordless plugin resolves an incoming verification event, it locates the existing account record for the target email and transitions its state to verified, issuing a new session. Before the fix, this state transition did not treat proof of email ownership as authoritative over previously stored credentials - it neither removed the password hash set during unverified pre-registration nor revoked sessions that had been created prior to any email verification. The library effectively conflated 'account exists for this email' with 'the current actor owns this account,' a pre-account-hijacking class flaw analogous to the OAuth pre-hijacking pattern documented in GHSA-g38m-r43w-p2q7. The fix (PR #10239, commit c06a56d) corrects this by treating the passwordless verification event as the canonical proof of ownership: it removes any previously set password and revokes all pre-existing sessions before issuing the new verified session.
Know when Better Auth gets its next vulnerability
- 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
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N
Network-reachable with no attacker privileges; victim's passwordless login triggers the flaw (UI:R); full account takeover yields C:H/I:H; A:L for minor session disruption to the victim.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
better-auth versions >= 1.1.3 and < 1.6.22 (and pre-release versions >= 1.7.0-beta.0 and < 1.7.0-beta.10) are vulnerable to account takeover via pre-account hijacking on magic-link and email-OTP sign-in when open email/password registration is enabled. An attacker registers an account with the victim's email address and an attacker-chosen password; the account remains unverified. When the legitimate owner later signs in via the magic-link or email-OTP passwordless flow, the account is marked verified without removing the pre-existing password or revoking existing sessions, so the attacker's password remains valid, granting persistent access to the victim's account. Fixed in 1.6.22 and 1.7.0-beta.10.
Blast Radius
ecosystem impact- 1 npm packages depend on better-auth (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 1.1.3.
Executive ViewAI
The better-auth npm library contains a pre-account hijacking vulnerability in passwordless authentication flows (magic links and email OTP) that allows an attacker to claim any user email address and set a password before the legitimate owner logs in. When the actual user later authenticates via the passwordless method, the library fails to clear the attacker's pre-existing password or sessions, granting the attacker persistent access to the account. Any organization using better-auth with passwordless authentication is immediately at risk of widespread account compromise without user knowledge.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
More in Better Auth
View allBetter Auth is an authentication library for TypeScript. Rated high severity (CVSS 7.9), this vulnerability is remotely
Authorization bypass in the @better-auth/oauth-provider plugin for Better Auth (versions >= 1.4.8-beta.7 and < 1.6.5, pl
Privilege-escalating account takeover in the @better-auth/scim plugin (versions 1.4.0-beta.27 through 1.6.21 and 1.7.0-b
Authentication bypass in Better Auth before 1.6.11 stems from insecure cryptographic defaults in the legacy oidcProvider
Denial of service in Better Auth (npm) before 1.4.2 lets an unauthenticated remote attacker poison the router's base pat
Unauthenticated OAuth state values can be redeemed as Magic Link tokens in Better Auth 1.4.0-beta.18 through 1.7.6, lett
Authentication bypass in Better Auth's OAuth Proxy plugin (versions 1.5.0-beta.12 through 1.7.6) lets unauthenticated re
Path normalization bypass in Better Auth before v1.4.5 allows unauthenticated remote attackers to circumvent `disabledPa
Authorization bypass in @better-auth/scim versions 1.5.0 through 1.7.0-beta.3 allows any authenticated user to fully tak
Multiple authentication bypass vulnerabilities in @better-auth/sso before version 1.6.21 enable low-privileged attackers
Two domain-ownership authentication bypass flaws in @better-auth/sso allow authenticated organization owners to compromi
Better Auth versions 1.3.8-beta.3 to before 1.7.0-rc.3 with the deviceAuthorization plugin enabled are vulnerable to a U
EUVD-2026-51841
GHSA-9wm3-rh5c-fc37
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB