GHSA-965C-763C-88JM
Vulnerability from github – Published: 2026-10-27 15:32 – Updated: 2026-10-27 15:32Am I affected?
You may be affected if you use better-auth from 1.4.0-beta.18 through versions before 1.7.7 with the Magic Link plugin and social or Generic OAuth sign-in.
You are affected if all of these are true:
- Magic Link is enabled with default
storeToken: "plain", or withstoreToken: "hashed"and globalverification.storeIdentifier: "hashed"(including a hashed default). - At least one built-in social provider or Generic OAuth provider is enabled.
- OAuth state uses
account.storeStateStrategy: "database", the default when a database or secondary storage is configured.
Cookie-backed state blocks this path, subject to the OAuth Proxy condition below. With custom hashers, confirm the flows cannot resolve to the same stored identifier.
Summary
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.
Impact
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. Applications that trust verified email addresses or email domains may give this account more access, depending on the application.
Patches
The fix is merged for the planned better-auth 1.7.7 release. That package is not available yet.
Upgrade better-auth and installed Better Auth adapters, plugins, and integrations released alongside it together. Upgrade servers sharing verification storage in the same cutover. Request new Magic Links and restart pending OAuth or SAML sign-ins; links and state created before the upgrade cannot complete. Update custom verification.storeIdentifier.overrides rules to match the magic-link: and auth-state: prefixes. There is no user or account data migration, and public token values and API signatures are unchanged.
Workarounds
Until you upgrade to the fixed release, use one of these mitigations:
- Set
account.storeStateStrategyto"cookie". If you also use OAuth Proxy, first configure one dedicated OAuth Proxysecretacross 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
storeTokento"hashed"and leave globalverification.storeIdentifierunset or set it to"plain". Global identifier hashing does not prevent this issue when Magic Link tokens are also hashed. - Turn off Magic Link sign-in, or turn off social and Generic OAuth sign-in.
Setting disableSignUp: true on the Magic Link plugin is not enough. It only stops the creation of new verified accounts. It does not stop the takeover of existing accounts.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "better-auth"
},
"ranges": [
{
"events": [
{
"introduced": "1.4.0-beta.18"
},
{
"fixed": "1.7.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-114607"
],
"database_specific": {
"cwe_ids": [
"CWE-287"
],
"github_reviewed": true,
"github_reviewed_at": "2026-10-27T15:32:05Z",
"nvd_published_at": "2026-10-22T17:16:58Z",
"severity": "CRITICAL"
},
"details": "## Am I affected?\n\nYou may be affected if you use `better-auth` from `1.4.0-beta.18` through versions before `1.7.7` with the Magic Link plugin and social or Generic OAuth sign-in.\n\nYou are affected if **all** of these are true:\n\n- Magic Link is enabled with default `storeToken: \"plain\"`, or with `storeToken: \"hashed\"` and global `verification.storeIdentifier: \"hashed\"` (including a hashed default).\n- At least one built-in social provider or Generic OAuth provider is enabled.\n- OAuth state uses `account.storeStateStrategy: \"database\"`, the default when a database or secondary storage is configured.\n\nCookie-backed state blocks this path, subject to the OAuth Proxy condition below. With custom hashers, confirm the flows cannot resolve to the same stored identifier.\n\n## Summary\n\nBetter 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.\n\n## Impact\n\nAn unauthenticated attacker who knows a user\u0027s email address can get a normal session for that user, with all of that account\u0027s 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.\n\nIf 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\u0027s default unproven-account protections when the mailbox owner later signs in, leaving the attacker\u0027s session in that account. Applications that trust verified email addresses or email domains may give this account more access, depending on the application.\n\n## Patches\n\nThe fix is merged for the planned `better-auth` 1.7.7 release. That package is not available yet.\n\nUpgrade `better-auth` and installed Better Auth adapters, plugins, and integrations released alongside it together. Upgrade servers sharing verification storage in the same cutover. Request new Magic Links and restart pending OAuth or SAML sign-ins; links and state created before the upgrade cannot complete. Update custom `verification.storeIdentifier.overrides` rules to match the `magic-link:` and `auth-state:` prefixes. There is no user or account data migration, and public token values and API signatures are unchanged.\n\n## Workarounds\n\nUntil you upgrade to the fixed release, use one of these mitigations:\n\n- 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\u0027s 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.\n- Set the Magic Link plugin option `storeToken` to `\"hashed\"` **and** leave global `verification.storeIdentifier` unset or set it to `\"plain\"`. Global identifier hashing does not prevent this issue when Magic Link tokens are also hashed.\n- Turn off Magic Link sign-in, or turn off social and Generic OAuth sign-in.\n\nSetting `disableSignUp: true` on the Magic Link plugin is not enough. It only stops the creation of new verified accounts. It does not stop the takeover of existing accounts.",
"id": "GHSA-965c-763c-88jm",
"modified": "2026-10-27T15:32:05Z",
"published": "2026-10-27T15:32:05Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/better-auth/better-auth/security/advisories/GHSA-965c-763c-88jm"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-114607"
},
{
"type": "WEB",
"url": "https://github.com/better-auth/better-auth/pull/11494"
},
{
"type": "WEB",
"url": "https://github.com/better-auth/better-auth/commit/ac54bfd67821a7607533af2059858b12bc54e26a"
},
{
"type": "PACKAGE",
"url": "https://github.com/better-auth/better-auth"
},
{
"type": "WEB",
"url": "https://github.com/better-auth/better-auth/releases/tag/v1.7.7"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "better-auth: OAuth state can be used as a Magic Link to sign in as another user"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.