GHSA-xg6x-h9c9-2m83: Better auth Authentication Bypass Vulnerability
CRITICALGHSA-xg6x-h9c9-2m83 is a CRITICAL authentication bypass vulnerability (CWE-288: Authentication Bypass Using an Alternate Path or Channel) affecting Better auth libraries in the npm ecosystem. The issue involves better auth has two-factor authentication bypass via premature session caching (session.cookiecache). Remediation is available by upgrading affected packages to version 1.4.9.
GHSA-xg6x-h9c9-2m83 at a Glance
How to Fix GHSA-xg6x-h9c9-2m83
To remediate this vulnerability, upgrade all affected Better auth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install better-auth@1.4.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls better-auth
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-xg6x-h9c9-2m83, inspect your project dependencies using npm:
npm ls better-auth
Analyze the terminal output to locate any version of Better auth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.9), your application is affected.
Note: The npm ls better-auth command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-288: Authentication Bypass Using an Alternate Path or Channel, where the product requires authentication, but the product has an alternate path or channel that does not require authentication. In Better auth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-xg6x-h9c9-2m83 Affected Better auth Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
better-auth
|
npm |
< 1.4.9
|
1.4.9
|
References
Frequently Asked Questions
What is GHSA-xg6x-h9c9-2m83?
Which Better auth versions are affected?
What version fixes GHSA-xg6x-h9c9-2m83?
Is better-auth affected?
What CWE is associated with GHSA-xg6x-h9c9-2m83?
How can I check npm dependencies for GHSA-xg6x-h9c9-2m83?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xg6x-h9c9-2m83",
"modified" : "2026-04-03T03:29:59Z",
"published" : "2026-04-03T03:29:59Z",
"aliases" : [ ],
"summary" : "Better Auth Has Two-Factor Authentication Bypass via Premature Session Caching (session.cookieCache)",
"details" : "### Summary\n\nUnder certain configurations, sessions may be considered valid before two-factor authentication (2FA) is fully completed. This can allow access to authenticated routes without verifying the second factor.\n\n---\n\n### Description\n\nWhen two-factor authentication is enabled, the authentication flow correctly identifies users who require additional verification and defers full authentication until the second factor is completed.\n\nHowever, when `session.cookieCache` is enabled, the session generated during the initial sign-in step may be cached as valid **prior to 2FA verification**. Subsequent session lookups may then return this cached session without re-evaluating the 2FA requirement.\n\nThis results in a situation where session validity can be established before all authentication constraints are satisfied.\n\n---\n\n### Impact\n\nAn attacker (or user) with valid primary credentials may gain access to protected application routes without completing the required second authentication factor.\n\nAny application using `better-auth` with both two-factor authentication and session cookie caching enabled may be affected.\n\n---\n\n### Mitigation\n\n* Upgrade to a version of `better-auth` that includes the fix for this issue.\n* Ensure that session caching does not treat sessions as fully authenticated until all required authentication steps, including 2FA, are completed.\n* As a temporary workaround, disable `session.cookieCache` when using two-factor authentication.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "better-auth"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.9"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-xg6x-h9c9-2m83"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/better-auth/better-auth"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-288" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-03T03:29:59Z",
"nvd_published_at" : null
}
}