Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:npm/better-auth@1.3.26
purl pkg:npm/better-auth@1.3.26
Next non-vulnerable version 1.4.9
Latest non-vulnerable version 1.6.11
Risk
Vulnerabilities affecting this package (3)
Vulnerability Summary Fixed by
VCID-hv9u-qvqb-c3by
Aliases:
GHSA-xg6x-h9c9-2m83
Better Auth Has Two-Factor Authentication Bypass via Premature Session Caching (session.cookieCache) ### Summary Under 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. --- ### Description When 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. However, 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. This results in a situation where session validity can be established before all authentication constraints are satisfied. --- ### Impact An attacker (or user) with valid primary credentials may gain access to protected application routes without completing the required second authentication factor. Any application using `better-auth` with both two-factor authentication and session cookie caching enabled may be affected. --- ### Mitigation * Upgrade to a version of `better-auth` that includes the fix for this issue. * Ensure that session caching does not treat sessions as fully authenticated until all required authentication steps, including 2FA, are completed. * As a temporary workaround, disable `session.cookieCache` when using two-factor authentication.
1.4.9
Affected by 0 other vulnerabilities.
VCID-wvwj-npt5-qye2
Aliases:
GHSA-x732-6j76-qmhm
Better Auth's rou3 Dependency has Double-Slash Path Normalization which can Bypass disabledPaths Config and Rate Limits
1.4.5
Affected by 1 other vulnerability.
VCID-z32n-9h42-cbd3
Aliases:
GHSA-569q-mpph-wgww
Better Auth affected by external request basePath modification DoS
1.4.2
Affected by 2 other vulnerabilities.
Vulnerabilities fixed by this package (1)
Vulnerability Summary Aliases
VCID-xcfr-utg2-u7a8 Better Auth is an authentication and authorization library for TypeScript. In versions prior to 1.3.26, unauthenticated attackers can create or modify API keys for any user by passing that user's id in the request body to the `api/auth/api-key/create` route. `session?.user ?? (authRequired ? null : { id: ctx.body.userId })`. When no session exists but `userId` is present in the request body, `authRequired` becomes false and the user object is set to the attacker-controlled ID. Server-only field validation only executes when `authRequired` is true (lines 280-295), allowing attackers to set privileged fields. No additional authentication occurs before the database operation, so the malicious payload is accepted. The same pattern exists in the update endpoint. This is a critical authentication bypass enabling full an unauthenticated attacker can generate an API key for any user and immediately gain complete authenticated access. This allows the attacker to perform any action as the victim user using the api key, potentially compromise the user data and the application depending on the victim's privileges. Version 1.3.26 contains a patch for the issue. CVE-2025-61928
GHSA-99h5-pjcv-gr6v

Date Actor Action Vulnerability Source VulnerableCode Version
2026-06-12T21:52:23.959667+00:00 GitLab Importer Affected by VCID-hv9u-qvqb-c3by https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/better-auth/GHSA-xg6x-h9c9-2m83.yml 38.6.0
2026-06-12T20:40:28.693325+00:00 GitLab Importer Affected by VCID-wvwj-npt5-qye2 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/better-auth/GHSA-x732-6j76-qmhm.yml 38.6.0
2026-06-12T20:37:26.412343+00:00 GitLab Importer Affected by VCID-z32n-9h42-cbd3 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/better-auth/GHSA-569q-mpph-wgww.yml 38.6.0
2026-06-12T15:48:55.034409+00:00 GitLab Importer Fixing VCID-xcfr-utg2-u7a8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/better-auth/CVE-2025-61928.yml 38.6.0
2026-06-12T07:52:35.590367+00:00 GithubOSV Importer Fixing VCID-xcfr-utg2-u7a8 https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/10/GHSA-99h5-pjcv-gr6v/GHSA-99h5-pjcv-gr6v.json 38.6.0
2026-06-11T20:36:26.566169+00:00 GHSA Importer Fixing VCID-xcfr-utg2-u7a8 https://github.com/advisories/GHSA-99h5-pjcv-gr6v 38.6.0