Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify app with cookie state storage and pkce:false
-
DeliveryAuthenticate with provider to obtain attacker-controlled code
-
ExploitLure victim to initiate OAuth login flow
-
ExecutionInject forged state and attacker code into victim's callback request
-
PersistServer skips nonce comparison in parseGenericState
-
ImpactSession or account link minted for victim bound to attacker identity
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 | Exploitation requires all four of the following conditions to be simultaneously true: (1) the application runs better-auth at a version below 1.6.2; (2) the application explicitly sets |
| Impact | The CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:P/VI:H) and resulting score of 6.0 accurately reflect substantial real-world friction: high attack complexity, specific attack prerequisites (AT:P), and required user interaction all reduce practical exploitability. The critical limiting factor is that the vulnerability only manifests when the application explicitly sets |
| Exploit ScenarioDerived | An attacker targets a victim actively using an application that runs better-auth with |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 01, 2026
OAuth state validation bypass in better-auth before 1.6.2 enables network-based attackers to forge the OAuth callback state parameter and supply attacker-controlled authorization codes, creating authenticated sessions in the victim's browser that are cryptographically bound to the attacker's external identity. Account-linking flows are equally exposed, permitting the attacker's provider account to be persistently linked to an authenticated victim row in the application's user store. Exploitation is constrained to a specific non-default configuration (cookie-backed state storage with PKCE disabled), and no public exploit has been identified at time of analysis.
RemediationAI
The primary remediation is to upgrade to better-auth 1.6.2 or later (current stable: 1.6.10) via npm install better-auth@latest; the patch was merged in PR #8949 (commit 9deb7936a) on 2026-04-09 and is confirmed fixed per the vendor advisory at https://github.com/better-auth/better-auth/security/advisories/GHSA-wxw3-q3m9-c3jr. For deployments that cannot immediately upgrade, the vendor documents two effective workarounds: first, switch betterAuth({ account: { storeStateStrategy } }) from 'cookie' back to the default value 'database', which is not affected because its state lookup is keyed by the state value itself - this requires the application's database to handle state table writes and may affect deployments in stateless or cookie-only environments; second, enable PKCE (pkce: true) on all OAuth providers configured via genericOAuth, which prevents an attacker-supplied code from completing the token exchange without the corresponding code verifier - this requires that all upstream providers support PKCE, which should be verified before enabling. Applying either workaround eliminates the attack path without a version upgrade, but upgrading remains the authoritative fix.
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 an npm authentication library (CPE: cpe:2.3:a:better-auth:better-auth:*:*:*:*:*:*:*:*) that implements OAuth 2.0 social login, generic OAuth, OIDC SSO, and SAML relay flows. The defect (CWE-287: Improper Authentication) lives in parseGenericState, the shared primitive that validates the OAuth state parameter returned by identity providers at the authorization callback. The cookie-backed branch of that function decrypted the oauth_state cookie and verified its expiry but never compared the incoming state query parameter to the nonce that generateGenericState had embedded in the cookie at sign-in initiation. The database-backed path (the library default) was immune because its verification row is keyed by state value, making equality enforcement implicit in the lookup itself. The vulnerable code path affects every flow that passes through parseGenericState with cookie storage active: generic-oauth, social providers, account-link, oauth-proxy passthrough, OIDC SSO, and SAML relay state. The fix (PR #8949, commit 9deb7936a) writes oauthState: state into the encrypted cookie payload at generation time and rejects callbacks where parsedData.oauthState !== state.
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:H/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Network-delivered OAuth callback attack requiring non-default cookie config, user interaction to complete forged callback, and no confidentiality impact - only high integrity loss via session or account hijack.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
1DescriptionCVE.org
better-auth versions before 1.6.2 fail to validate the OAuth state parameter against the stored nonce when using cookie-backed state storage without PKCE. Attackers can forge the state parameter and supply an attacker-controlled authorization code to create authenticated sessions bound to the attacker's external identity or persistently link attacker accounts to victim profiles.
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
Pre-account hijacking in better-auth (npm) allows a remote attacker to gain persistent, password-based access to any vic
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
EUVD-2026-51852
GHSA-4hp3-gxv8-7g37
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB