Description
Better Auth is an authentication and authorization library for TypeScript. From 1.4.0-beta.18 until 1.7.7, deployments that enable Magic Link with storeToken set to plain, or with storeToken set to hashed and the global verification.storeIdentifier setting also set to hashed, enable a built-in social or Generic OAuth provider, and use account.storeStateStrategy set to database can accept an OAuth sign-in state value as a Magic Link token. These settings can cause Magic Link verification records and OAuth state to resolve to the same stored identifier, allowing an unauthenticated attacker to start OAuth sign-in for a known email address and redeem the returned state through Magic Link without controlling the mailbox or completing the provider callback. The attacker can obtain a normal session for an existing user, or create an account incorrectly marked as email verified when sign-up is enabled. This issue is fixed in version 1.7.7.
Published: 2026-10-22
Score: 9.1 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Account Takeover
Action: Immediate Patch
AI Analysis

Impact

The vulnerability allows an unauthenticated attacker to hijack an existing user account by exploiting the OAuth sign‑in state as a Magic Link token. It stems from an improper authentication process (CWE‑287), where the same identifier is used for Magic Link verification records and OAuth state when certain configuration options are enabled. An attacker can trigger an OAuth flow for a known email address, intercept the returned state, and use it as a Magic Link to obtain a normal session for the target user or to create a new account marked as verified. The severity is high, with a CVSS score of 9.1, and the issue remains exploitable on unpatched installations.

Affected Systems

This flaw exists in the Better Auth authentication library for TypeScript, versions 1.4.0‑beta.18 through 1.7.7, when deployments enable Magic Link with the storeToken option set to plain or hashed (and the global verification.storeIdentifier setting also set to hashed), use a built‑in social or generic OAuth provider, and configure account.storeStateStrategy to use a database. Deployments that use any of these combinations are vulnerable unless patched.

Risk and Exploitability

The attack vector is remote; an attacker only needs to initiate the OAuth flow for the victim’s email address. No mailbox control or provider callback completion is required. Because the vulnerability passes the OAuth state through the Magic Link verification process, it can be exploited from the internet against exposed endpoints. With a CVSS of 9.1, the potential impact is significant. The EPSS score is currently not available, and the vulnerability is not listed in CISA’s KEV catalog, but the high score and the ease of exploitation warrant immediate attention.

Generated by OpenCVE AI on October 22, 2026 at 19:07 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest release of Better Auth (v1.7.7 or later) that contains the authentication bypass fix.
  • Reconfigure the Magic Link and OAuth settings so that the state storage strategy does not reuse the same identifiers as Magic Link tokens – for example, set storeToken to a secure hash and use a state store other than the database.
  • If immediate patching is not possible, disable Magic Link functionality or restrict its endpoints to trusted internal networks to mitigate exposure.

Generated by OpenCVE AI on October 22, 2026 at 19:07 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-965c-763c-88jm better-auth: OAuth state can be used as a Magic Link to sign in as another user
History

Fri, 23 Oct 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 23 Oct 2026 00:45:00 +0000

Type Values Removed Values Added
First Time appeared Better-auth
Better-auth better Auth
Vendors & Products Better-auth
Better-auth better Auth

Thu, 22 Oct 2026 17:00:00 +0000

Type Values Removed Values Added
Description Better Auth is an authentication and authorization library for TypeScript. From 1.4.0-beta.18 until 1.7.7, deployments that enable Magic Link with storeToken set to plain, or with storeToken set to hashed and the global verification.storeIdentifier setting also set to hashed, enable a built-in social or Generic OAuth provider, and use account.storeStateStrategy set to database can accept an OAuth sign-in state value as a Magic Link token. These settings can cause Magic Link verification records and OAuth state to resolve to the same stored identifier, allowing an unauthenticated attacker to start OAuth sign-in for a known email address and redeem the returned state through Magic Link without controlling the mailbox or completing the provider callback. The attacker can obtain a normal session for an existing user, or create an account incorrectly marked as email verified when sign-up is enabled. This issue is fixed in version 1.7.7.
Title better-auth: OAuth state can be used as a Magic Link to sign in as another user
Weaknesses CWE-287
References
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}


Subscriptions

Better-auth Better Auth
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-23T15:02:40.820Z

Reserved: 2026-10-21T20:34:25.599Z

Link: CVE-2026-114607

cve-icon Vulnrichment

Updated: 2026-10-23T14:55:53.967Z

cve-icon NVD

Status : Deferred

Published: 2026-10-22T17:16:58.577

Modified: 2026-10-23T15:17:26.763

Link: CVE-2026-114607

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T19:15:10Z

Weaknesses