What happened#
On 30 September 2026 the better-auth maintainers published a security advisory titled “OAuth state usable as a Magic Link”. It says that in affected versions, the value used as OAuth sign-in state is also accepted as a Magic Link token. An attacker starts an OAuth sign-in for the victim’s email address, then presents the returned state value as if it were a Magic Link. The attacker never needs to open the victim’s mailbox.
The advisory’s impact section is plain: the attacker ends up with a normal session carrying that account’s permissions. If Magic Link sign-up is enabled and no account exists yet for that email, the attacker can create one that is wrongly marked as email verified. It adds that setting disableSignUp: true on the Magic Link plugin does not stop takeover of accounts that already exist.
GitHub added the same advisory to its reviewed Advisory Database on 27 October, where it is tagged CWE-287 (improper authentication) and shows the same 9.1 rating; the database page also records NVD publishing it on 22 October. The reporters credited are rick-v12 and bazumo.
| Item | Value |
|---|---|
| CVE / advisory | CVE-2026-114607 / GHSA-965c-763c-88jm |
| Severity | Critical, CVSS 3.1 base score 9.1 (network, no privileges, no user interaction) |
| Package | better-auth (npm) |
| Affected | 1.4.0-beta.18 up to, but not including, 1.7.7 |
| Patched | 1.7.7 |
| Weakness | CWE-287, improper authentication |
The fix, in pull request #11494, makes Magic Link redeem only records that were issued for Magic Link. According to the pull request, Magic Link identifiers now carry a magic-link: prefix, database-backed OAuth and SAML state carries an auth-state: prefix, and Magic Link checks each record’s purpose before consuming it. The 1.7.7 release notes describe it as fixing a critical Magic Link account-takeover vulnerability, and say 1.7.7 shipped on 30 September.
Am I affected?#
The advisory says all three of these conditions must hold. If any one is false, the advisory does not list you as exposed.
| Condition | Where to look |
|---|---|
| Magic Link is enabled with storeToken: "plain", or with storeToken: "hashed" plus global verification.storeIdentifier: "hashed" | Your magicLink plugin options and your verification settings in the better-auth config |
| At least one built-in social provider or Generic OAuth provider is enabled | socialProviders and the genericOAuth plugin in the same config |
| OAuth state uses the database strategy (account.storeStateStrategy), which is the default when a database or secondary storage is configured | The account options; if you never set it and you have a database, you are probably on the default |
Separately, you need to be on a version below 1.7.7. If you use the OAuth Proxy plugin, the release notes say a related fix stops it accepting sign-in state as a provider profile, and that all OAuth Proxy participants should be upgraded together.
What to do now#
- Find the version that is actually running, not just the one in your repo. A lockfile updated on a laptop says nothing about production.
- Upgrade to 1.7.7 or later, and keep related adapters, plugins and integrations on the same release. The advisory says servers that share verification storage should be upgraded in the same change.
- Expect some sign-in friction. The advisory says links and OAuth or SAML state created before the upgrade will not complete, so users must request a new Magic Link and restart pending sign-ins. It says no schema or account data migration is needed.
- If you use custom storage rules, the advisory says to update any custom identifier rules so they recognise the
magic-link:andauth-state:prefixes. - Look at your logs for Magic Link sign-ins that don’t match a Magic Link email you sent. The sources I read don’t say what exploitation looks like, so that is a general suggestion, not something from the advisory.
# Which version is installed?
npm ls better-auth
# Upgrade, then deploy
npm install better-auth@latest
# Confirm after the deploy, on the server itself
npm ls better-authIf you can’t upgrade today, the advisory lists these workarounds. Any one of them is described as enough to remove a condition above:
- Set
account.storeStateStrategyto"cookie". If you use OAuth Proxy, first give it a dedicated secret that differs from the global one. - Set the Magic Link
storeTokento"hashed", and leave globalverification.storeIdentifierunset or"plain". - Turn off Magic Link sign-in, or turn off social and Generic OAuth sign-in.
What the sources don’t say#
- Whether anyone has exploited this in the wild. The advisory doesn’t mention it either way.
- How many projects are running a vulnerable combination. The advisory describes the conditions but gives no numbers.
- What exploitation would look like in logs. Neither the advisory nor the fix says.
- Other
better-authadvisories. Searching turned up separate Magic Link and OAuth state issues with different identifiers and fix versions. I did not read those for this post, so don’t treat this one as the whole picture for the library.
My take#
My own opinion, not from the advisory.
The pattern here is two features that are fine alone and dangerous together: a one-time token and an OAuth state value ended up in the same storage, and nothing checked what each record was for. If you build or review authentication, “what was this token issued for?” is a question worth asking of every token you accept. Practically, a critical fix that is a month old and needs a particular combination of settings is easy to miss, so I’d spend ten minutes on the three-condition check this week.
Sources#
- better-auth: OAuth state usable as a Magic Link (GHSA-965c-763c-88jm), primary source
- GitHub Advisory Database: better-auth OAuth state usable as a Magic Link (CVE-2026-114607)
- better-auth: isolate verification records and encryption purposes (#11494)
- better-auth: release v1.7.7
Keep reading
8 min read
Nuxt 4.6.4 security release: eight advisories, including two route-rule and middleware bypasses. What to upgrade to, and how to check your app
Nuxt 4.6.4 fixes eight advisories: a leading // and an encoded %2F that can skip middleware and route rules, a dev-server file read, leaked error details and more.
7 min read
Hono advisories, November 2026 (CVE-2026-126355 to 126359 and more): what to upgrade to, and how to check your middleware
Hono 4.13.16 fixes five advisories: mount() and RegExpRouter middleware bypasses, a csrf() gap and a form validator skip. Plus two @hono/node-server fixes. What to check.