<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Better-Auth — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/better-auth/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 03 Apr 2026 03:29:59 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/better-auth/feed.xml" rel="self" type="application/rss+xml"/><item><title>Better Auth Two-Factor Authentication Bypass Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-02-better-auth-2fa-bypass/</link><pubDate>Fri, 03 Apr 2026 03:29:59 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-02-better-auth-2fa-bypass/</guid><description>Better Auth versions prior to 1.4.9 have a critical two-factor authentication bypass vulnerability; when session.cookieCache is enabled, the initial sign-in session may be improperly cached, allowing attackers with valid credentials to bypass 2FA.</description><content:encoded><![CDATA[<p>Better Auth versions prior to 1.4.9 contain a critical vulnerability that can lead to two-factor authentication (2FA) bypass. The vulnerability arises when the <code>session.cookieCache</code> is enabled. In this configuration, the initial session created during the login process can be prematurely cached before the 2FA verification is completed. Consequently, subsequent session lookups might use this cached session, circumventing the necessary 2FA check. This issue allows an attacker who possesses valid primary credentials to gain unauthorized access to protected application routes without completing the mandated second authentication factor. Any application leveraging <code>better-auth</code> with 2FA and session cookie caching enabled is potentially vulnerable.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>User attempts to log in with valid username and password.</li>
<li>The application, running a vulnerable version of <code>better-auth</code> with <code>session.cookieCache</code> enabled, creates a session.</li>
<li>The session is cached due to the <code>session.cookieCache</code> setting, <em>before</em> the 2FA challenge is presented.</li>
<li>The user is prompted for their second factor (e.g., TOTP code).</li>
<li>Instead of providing the 2FA code, the attacker intercepts or reuses the cached session cookie.</li>
<li>The attacker presents the cached session cookie to the application.</li>
<li>The application retrieves the cached session, which it prematurely considers valid.</li>
<li>The attacker gains access to protected resources without completing 2FA.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability allows attackers with valid usernames and passwords to bypass two-factor authentication, gaining unauthorized access to sensitive application resources. The number of affected applications is unknown, but all applications using <code>better-auth</code> with 2FA and session caching are potentially at risk. A successful attack could lead to data breaches, account takeovers, and other serious security incidents.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to <code>better-auth</code> version 1.4.9 or later to patch the vulnerability.</li>
<li>Disable <code>session.cookieCache</code> when using two-factor authentication as a temporary mitigation.</li>
<li>If disabling <code>session.cookieCache</code> is not feasible, implement server-side checks to ensure 2FA is completed before granting full session validity (requires code modification).</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>authentication</category><category>2fa</category><category>bypass</category><category>better-auth</category></item></channel></rss>