All vulnerabilities

npm

CVE-2026-110862

better-auth: OAuth state can be used as a Magic Link to sign in as another user

Severity
Critical 9.1
Published
27 Oct 2026
Last changed
27 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.7.7
Exploit chance
0.3% in the next 30 daysHigher than 25% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Improper authentication (CWE-287)
Attack
Over the network · No login needed · No user action needed
Attacker can
Read data · Change data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Also known as
CVE-2026-114607, GHSA-965c-763c-88jm
Sources
OSV.dev and GitHub

Description

Better Auth accepts an OAuth sign-in state value as a Magic Link token. An attacker can start an OAuth sign-in with any email address and use the returned state value to finish a Magic Link sign-in for that address. They never prove that they can read that email.

An unauthenticated attacker who knows a user's email address can get a normal session for that user, with all of that account's permissions. They need no access to the mailbox, and they do not need to sign in with the OAuth provider or complete an OAuth callback.

If Magic Link sign-up is enabled and no user has the email address, the attacker can instead create an account that Better Auth wrongly marks as email verified, and is signed in to it. The false verified-email flag can also bypass Better Auth's default unproven-account protections when the mailbox owner later signs in, leaving the attacker's session in that account.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

Until you upgrade to the fixed release, use one of these mitigations:

  • Set account.storeStateStrategy to "cookie". If you also use OAuth Proxy, first configure one dedicated OAuth Proxy secret across all participating environments that differs from each environment's global Better Auth secret. Cookie-backed state can expose a separate OAuth Proxy account-takeover path when the proxy shares the global secret and implicit account linking is enabled.
  • Set the Magic Link plugin option storeToken to "hashed" and leave global verification.storeIdentifier unset or set it to "plain".
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
better-authnpm · osv:npm:better-auth
  • From 1.4.0-beta.18 before 1.7.7

About better-auth

Weekly downloads (npm)
21,121,233npm, 23 Nov 2026

References