Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain valid primary credentials
-
DeliveryInitiate sign-in (primary auth succeeds)
-
ExploitSession cached prematurely before 2FA gate
-
ExecutionSubmit subsequent request using cached session cookie
-
ImpactAccess protected routes without 2FA verification
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Alternate path authentication
|
| Exploitation Conditions | Exploitation requires three concrete conditions to be simultaneously true: (1) the target application must have better-auth's two-factor authentication plugin enabled; (2) the session.cookieCache option must be enabled in the better-auth configuration - this is a non-default feature that must be explicitly opted into; and (3) the attacker must possess valid primary credentials (username and password) for a target account subject to 2FA, placing this in the CVSS PR:L (low-privilege) category. What limits exploitation: applications using better-auth without session.cookieCache, or without 2FA, are not affected; this is not a default-configuration attack. The bypass is also limited to confidentiality (access to protected routes and data) - there is no integrity or availability impact described or implied by the CVSS vector. |
| Impact | The CVSS 4.0 base score of 7.1 (AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N) reflects that exploitation requires valid primary credentials (PR:L) but is otherwise straightforward over the network with no user interaction. The confidentiality impact is high on the vulnerable system, since 2FA is typically deployed to protect high-value accounts and sensitive routes. Critically, exploitation is conditional: both two-factor authentication and session.cookieCache must be simultaneously enabled, which is a non-default combination. The CVSS 4.0 vector assigns AT:N (no attack requirements beyond the attacker's control), but this understates the deployment prerequisite - only applications with both features active are affected. No public exploit code and no KEV listing exist at time of analysis, reducing immediate mass-exploitation risk. However, because the bypass is conceptually trivial once prerequisites are met (no memory corruption, no timing race - just a cache lookup ordering flaw), the barrier to exploitation is effectively the availability of valid credentials, not technical sophistication. |
| Exploit ScenarioDerived | An attacker who has obtained valid username and password credentials for a target account - through phishing, credential stuffing, or prior breach - initiates a sign-in request against an application using better-auth with both 2FA and session.cookieCache enabled. After primary authentication succeeds, the resulting session is written to the cookie cache as valid before the 2FA challenge is presented. The attacker then makes a subsequent authenticated request; the cache returns the pre-2FA session as fully authenticated, and the application grants access to protected routes without the attacker ever supplying or intercepting a one-time code. No public exploit code is known to exist at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 01, 2026
Two-factor authentication bypass in better-auth (npm) before version 1.4.9 allows network-accessible attackers holding valid primary credentials to access protected application routes without completing second-factor verification. The flaw stems from premature session caching: when session.cookieCache is enabled alongside 2FA, the session generated after primary sign-in is stored as fully valid before the second factor is checked, and subsequent lookups return the cached authenticated session without re-evaluating the 2FA requirement. No public exploit code or CISA KEV listing has been identified at time of analysis, but the attack is conceptually straightforward for any user or attacker who already possesses a valid username and password.
RemediationAI
The primary fix is to upgrade better-auth to version 1.4.9, which corrects the session caching logic to ensure sessions are not treated as fully authenticated until all required authentication steps, including 2FA, are completed. This is confirmed by both the GitHub GHSA-xg6x-h9c9-2m83 advisory and the npm package vulnerability data. As a temporary workaround for deployments that cannot upgrade immediately, disable the session.cookieCache option when two-factor authentication is active - this eliminates the premature caching path at the cost of increased database load on session lookups. Disabling cookieCache does not affect correctness, only performance. No other workarounds are described in available advisories. Advisory: https://github.com/better-auth/better-auth/security/advisories/GHSA-xg6x-h9c9-2m83.
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 open-source authentication framework for Node.js/TypeScript applications distributed via npm (CPE: cpe:2.3:a:better-auth:better-auth:*:*:*:*:*:*:*:*). The session.cookieCache feature is a performance optimization that stores resolved session data in a short-lived cookie-side cache to avoid repeated database lookups on every request. The root cause maps to CWE-288 (Authentication Bypass Using an Alternate Path or Channel): the caching layer represents an alternate path to session validation that bypasses the 2FA gate applied during the primary authentication flow. When the cache is consulted on a subsequent request, it returns the pre-2FA session object as fully authenticated, effectively short-circuiting the intended multi-step authentication logic.
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:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
AC:H reflects the non-default dual-configuration prerequisite (2FA and cookieCache both active); PR:L for required primary credentials; no integrity or availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
2DescriptionCVE.org
better-auth versions before 1.4.9 contain a two-factor authentication bypass vulnerability when session.cookieCache is enabled. Attackers with valid primary credentials can access authenticated routes without completing second-factor verification by exploiting premature session caching.
Executive ViewAI
better-auth (npm) before version 1.4.9 contains a two-factor authentication bypass flaw affecting users with valid primary credentials. While no public exploit has been identified at time of analysis, organizations using this library with session caching enabled face a critical vulnerability that directly undermines second-factor authentication-a primary defense against account compromise and credential theft.
Apply vendor patch.
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
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
Better Auth versions 1.3.8-beta.3 to before 1.7.0-rc.3 with the deviceAuthorization plugin enabled are vulnerable to a U
EUVD-2026-51837
GHSA-8pwm-pjg9-4h92
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB