better-auth

Ecosystem: npm

Downloads: 58.55 Mln

Vulnerabilities from the last (months)
  • 4CriticalAffects 4 versions
  • 16HighAffects 19 versions
  • 0MediumAffects 0 versions
  • 3ModerateAffects 3 versions
  • 4LowAffects 4 versions
Severity distribution (all time)
27vulnerabilities
  • Critical4 (14.8%)
  • High16 (59.3%)
  • Medium0 (0.0%)
  • Moderate3 (11.1%)
  • Low4 (14.8%)

Monthly breakdown

  • Critical
  • High
  • Medium
  • Moderate
  • Low
  • 4 vulnerabilities
    • Critical: 1
    • High: 2
    • Medium: 0
    • Moderate: 0
    • Low: 1
  • 1 vulnerabilities
    • Critical: 1
    • High: 0
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 9 vulnerabilities
    • Critical: 1
    • High: 7
    • Medium: 0
    • Moderate: 0
    • Low: 1
  • 1 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 2 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 1
    • Low: 0
  • 1 vulnerabilities
    • Critical: 1
    • High: 0
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 2 vulnerabilities
    • Critical: 0
    • High: 2
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 0
    • Low: 1
  • 1 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 0
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 0
    • Medium: 0
    • Moderate: 0
    • Low: 1
  • 3 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 2
    • Low: 0
  • 1 vulnerabilities
    • Critical: 0
    • High: 1
    • Medium: 0
    • Moderate: 0
    • Low: 0

Vulnerabilities (27)

Known vulnerabilities affecting better-auth, based on data from OSV.

Vulnerabilities affecting better-auth
IDSeveritySummaryAffected versionsPublishedSource
GHSA-44jh-23m7-hpcfLow@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL## Am I affected? You are affected if you use `@better-auth/drizzle-adapter` from 1.6.17 through versions before 1.7.7 (including the 1.7.0 prereleases from beta.6 through rc.6) or `@better-auth/kysely-adapter` 1.6.17 through 1.6.31, and keep rate-limit records in a PostgreSQL database. All of these must be true: - Rate limiting is enabled. - Rate-limit records are stored in the database. - The database is PostgreSQL, used through one of the adapter versions above. You are not affected if you store rate-limit records in memory (the default) or in secondary storage. ## Summary Database-ba
  • >= 1.6.17, < 1.7.7
GitHub (opens in a new tab)
GHSA-965c-763c-88jmCriticalbetter-auth: OAuth state can be used as a Magic Link to sign in as another user## Am I affected? You may be affected if you use `better-auth` from `1.4.0-beta.18` through versions before `1.7.7` with the Magic Link plugin and social or Generic OAuth sign-in. You are affected if **all** of these are true: - Magic Link is enabled with default `storeToken: "plain"`, or with `storeToken: "hashed"` and global `verification.storeIdentifier: "hashed"` (including a hashed default). - At least one built-in social provider or Generic OAuth provider is enabled. - OAuth state uses `account.storeStateStrategy: "database"`, the default when a database or secondary storage is config
  • >= 1.4.0-beta.18, < 1.7.7
GitHub (opens in a new tab)
GHSA-q84f-53jg-9ppmHighbetter-auth: Device login approval does not show the requesting client or permissions## Am I affected? You may be affected if you use `better-auth` from `1.3.8-beta.3` up to, but not including, `1.7.0-rc.3`, and you enable the `deviceAuthorization()` plugin. This range includes all 1.6 releases. You are affected only if all of these are also true: - An attacker can start a device request: `validateClient` is not configured, or the attacker can use a valid public client. - Before allowing approval, your approval page does not show, from server-checked data, which client is asking and the exact permissions it requests. - Users may approve a code or complete verification link
  • >= 1.3.8-beta.3, < 1.7.0-rc.3
GitHub (opens in a new tab)
GHSA-r4xp-prcw-77qfHighbetter-auth: OAuth Proxy lets an attacker sign in as another user## Am I affected? You may be affected if you use `better-auth` from 1.5.0-beta.12 through versions before 1.7.7 with the OAuth Proxy plugin. You are affected only if **all** of these are also true: - On a participating environment, the OAuth Proxy plugin has no dedicated `secret`, or its `secret` equals that environment's global Better Auth secret. - Sign-in state is stored in a cookie (`account.storeStateStrategy: "cookie"`). With a database or secondary storage, this is only the case if you chose it explicitly. - Implicit account linking is on (the default). You are not affected by this p
  • >= 1.5.0-beta.12, < 1.7.7
GitHub (opens in a new tab)
GHSA-3q45-2fh7-66cjCriticalDuplicate Advisory: better-auth has an external request basePath modification DoS## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-569q-mpph-wgww. This link is maintained to preserve external references. ## Original Description better-auth (npm) before 1.4.2 allows an external request to configure baseURL when it is not otherwise defined (e.g., BETTER_AUTH_URL is unset). An attacker able to make the very first request to the server after startup can poison the router's base path, causing all routes to return 404 for all users (denial of service). The issue is not reachable when baseURL is explicitly configured or on typical managed
  • < 1.4.2
GitHub (opens in a new tab)
GHSA-qq9h-g4jm-xgf3HighBetter Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in### Am I affected You are affected if all of the following hold: - You run a `better-auth` version below 1.6.22, or a `1.7.0-beta` below `1.7.0-beta.10`. - You enable the magic-link plugin or the email-OTP plugin. - You also enable email and password sign-up with open registration. - An account can exist at an address before its owner first signs in with the passwordless flow. ### Summary An attacker can keep password access to a victim's account after the victim starts using it. The attack runs in three steps. First, with open registration, the attacker signs up using the victim's email a
  • >= 1.1.3, < 1.6.22
  • >= 1.7.0-beta.0, < 1.7.0-beta.10
GitHub (opens in a new tab)
GHSA-2vg6-77g8-24mpLowBetter Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flows### Am I affected? Users are affected if all of the following are true: - They configure `secondaryStorage` on `betterAuth(...)` (Redis, KV, or any external session cache). - `session.storeSessionInDatabase` is left unset or set to `false` (the default). - Their application's deployment uses one or more of: - The `admin` plugin and calls `auth.api.removeUser(...)` or `authClient.admin.removeUser(...)`. - The `anonymous` plugin and exposes `/delete-anonymous-user` or relies on the after-link hook to clean up the anonymous user. - The `@better-auth/scim` plugin and exposes `DELETE /scim/
  • >= 0.3.4, < 1.6.11
GitHub (opens in a new tab)
GHSA-392p-2q2v-4372HighBetter Auth: OAuth refresh-token rotation forks the token family on concurrent redemption### Am I affected? Users are affected if all of the following are true: - Their project depends on `@better-auth/oauth-provider` at a version `>= 1.6.0, < 1.6.11`, or uses the embedded plugin in `better-auth >= 1.4.8-beta.7, < 1.6.0`. - At least one OAuth client served by their application's authorization server requests the `offline_access` scope, so refresh tokens are minted. - Concurrent redemption of the same refresh token is reachable: an SPA shares one refresh token across browser tabs without a mutex, a mobile client retries after a transient failure, an attacker who has stolen a refr
  • >= 1.4.8-beta.7, < 1.6.0
GitHub (opens in a new tab)
GHSA-7w99-5wm4-3g79High@better-auth/oauth-provider's OAuth authorization-code grant allows concurrent redemption when two token requests race the find-then-delete primitive### Am I affected? Users are affected if all of the following are true: - Their project depends on `@better-auth/oauth-provider` at a version `>= 1.6.0, < 1.6.11`, or uses the embedded plugin in `better-auth >= 1.4.8-beta.7, < 1.6.0`, or enables the legacy `oidc-provider` or `mcp` plugins from `better-auth/plugins`. - Their application exposes `/api/auth/oauth2/token` (or the legacy plugins' `/oauth2/token` and `/mcp/token`) as a token endpoint to OAuth/OIDC clients, including internal MCP clients (Claude Desktop, custom MCP tool callers, AI agents). - Their application has not implemented a
  • < 1.6.11
GitHub (opens in a new tab)
GHSA-86j7-9j95-vpqjHighBetter Auth has stored XSS in the auth-server origin via javascript: redirect_uri in oidc-provider and mcp### Am I affected? Check each condition. Users are affected when all of the first three hold. - Their application enables the `oidc-provider` plugin or the `mcp` plugin from `better-auth/plugins`. The `mcp` plugin wraps the same provider and carries the same defect. Both are on the migration path to `@better-auth/oauth-provider`, which is not affected. - Their application `better-auth` version is `1.6.12` or earlier on the stable line, or any `1.7.0-beta` build on the pre-release line. Both release lines carry the same defect. - Their application consent page is a client component that reads
  • < 1.6.13
  • >= 1.7.0-beta.0, < 1.7.0-beta.4
GitHub (opens in a new tab)
  • GHSA-44jh-23m7-hpcfLow
    @better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL
    • >= 1.6.17, < 1.7.7

    ## Am I affected? You are affected if you use `@better-auth/drizzle-adapter` from 1.6.17 through versions before 1.7.7 (including the 1.7.0 prereleases from beta.6 through rc.6) or `@better-auth/kysely-adapter` 1.6.17 through 1.6.31, and keep rate-limit records in a PostgreSQL database. All of these must be true: - Rate limiting is enabled. - Rate-limit records are stored in the database. - The database is PostgreSQL, used through one of the adapter versions above. You are not affected if you store rate-limit records in memory (the default) or in secondary storage. ## Summary Database-ba

    CVE: CVE-2026-110861

  • GHSA-965c-763c-88jmCritical
    better-auth: OAuth state can be used as a Magic Link to sign in as another user
    • >= 1.4.0-beta.18, < 1.7.7

    ## Am I affected? You may be affected if you use `better-auth` from `1.4.0-beta.18` through versions before `1.7.7` with the Magic Link plugin and social or Generic OAuth sign-in. You are affected if **all** of these are true: - Magic Link is enabled with default `storeToken: "plain"`, or with `storeToken: "hashed"` and global `verification.storeIdentifier: "hashed"` (including a hashed default). - At least one built-in social provider or Generic OAuth provider is enabled. - OAuth state uses `account.storeStateStrategy: "database"`, the default when a database or secondary storage is config

    CVE: CVE-2026-110862

  • GHSA-q84f-53jg-9ppmHigh
    better-auth: Device login approval does not show the requesting client or permissions
    • >= 1.3.8-beta.3, < 1.7.0-rc.3

    ## Am I affected? You may be affected if you use `better-auth` from `1.3.8-beta.3` up to, but not including, `1.7.0-rc.3`, and you enable the `deviceAuthorization()` plugin. This range includes all 1.6 releases. You are affected only if all of these are also true: - An attacker can start a device request: `validateClient` is not configured, or the attacker can use a valid public client. - Before allowing approval, your approval page does not show, from server-checked data, which client is asking and the exact permissions it requests. - Users may approve a code or complete verification link

    CVE: CVE-2026-109346

  • GHSA-r4xp-prcw-77qfHigh
    better-auth: OAuth Proxy lets an attacker sign in as another user
    • >= 1.5.0-beta.12, < 1.7.7

    ## Am I affected? You may be affected if you use `better-auth` from 1.5.0-beta.12 through versions before 1.7.7 with the OAuth Proxy plugin. You are affected only if **all** of these are also true: - On a participating environment, the OAuth Proxy plugin has no dedicated `secret`, or its `secret` equals that environment's global Better Auth secret. - Sign-in state is stored in a cookie (`account.storeStateStrategy: "cookie"`). With a database or secondary storage, this is only the case if you chose it explicitly. - Implicit account linking is on (the default). You are not affected by this p

    CVE: CVE-2026-110864

  • GHSA-3q45-2fh7-66cjCritical
    Duplicate Advisory: better-auth has an external request basePath modification DoS
    • < 1.4.2

    ## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-569q-mpph-wgww. This link is maintained to preserve external references. ## Original Description better-auth (npm) before 1.4.2 allows an external request to configure baseURL when it is not otherwise defined (e.g., BETTER_AUTH_URL is unset). An attacker able to make the very first request to the server after startup can poison the router's base path, causing all routes to return 404 for all users (denial of service). The issue is not reachable when baseURL is explicitly configured or on typical managed

  • GHSA-qq9h-g4jm-xgf3High
    Better Auth: Account takeover via pre-account hijacking on magic-link and email-OTP sign-in
    • >= 1.1.3, < 1.6.22
    • >= 1.7.0-beta.0, < 1.7.0-beta.10

    ### Am I affected You are affected if all of the following hold: - You run a `better-auth` version below 1.6.22, or a `1.7.0-beta` below `1.7.0-beta.10`. - You enable the magic-link plugin or the email-OTP plugin. - You also enable email and password sign-up with open registration. - An account can exist at an address before its owner first signs in with the passwordless flow. ### Summary An attacker can keep password access to a victim's account after the victim starts using it. The attack runs in three steps. First, with open registration, the attacker signs up using the victim's email a

    CVE: CVE-2026-67327

  • GHSA-2vg6-77g8-24mpLow
    Better Auth: Stale sessions persist after user deletion across admin, anonymous, and SCIM flows
    • >= 0.3.4, < 1.6.11

    ### Am I affected? Users are affected if all of the following are true: - They configure `secondaryStorage` on `betterAuth(...)` (Redis, KV, or any external session cache). - `session.storeSessionInDatabase` is left unset or set to `false` (the default). - Their application's deployment uses one or more of: - The `admin` plugin and calls `auth.api.removeUser(...)` or `authClient.admin.removeUser(...)`. - The `anonymous` plugin and exposes `/delete-anonymous-user` or relies on the after-link hook to clean up the anonymous user. - The `@better-auth/scim` plugin and exposes `DELETE /scim/

    CVE: CVE-2026-67334

  • GHSA-392p-2q2v-4372High
    Better Auth: OAuth refresh-token rotation forks the token family on concurrent redemption
    • >= 1.4.8-beta.7, < 1.6.0

    ### Am I affected? Users are affected if all of the following are true: - Their project depends on `@better-auth/oauth-provider` at a version `>= 1.6.0, < 1.6.11`, or uses the embedded plugin in `better-auth >= 1.4.8-beta.7, < 1.6.0`. - At least one OAuth client served by their application's authorization server requests the `offline_access` scope, so refresh tokens are minted. - Concurrent redemption of the same refresh token is reachable: an SPA shares one refresh token across browser tabs without a mutex, a mobile client retries after a transient failure, an attacker who has stolen a refr

    CVE: CVE-2026-53517

  • GHSA-7w99-5wm4-3g79High
    @better-auth/oauth-provider's OAuth authorization-code grant allows concurrent redemption when two token requests race the find-then-delete primitive
    • < 1.6.11

    ### Am I affected? Users are affected if all of the following are true: - Their project depends on `@better-auth/oauth-provider` at a version `>= 1.6.0, < 1.6.11`, or uses the embedded plugin in `better-auth >= 1.4.8-beta.7, < 1.6.0`, or enables the legacy `oidc-provider` or `mcp` plugins from `better-auth/plugins`. - Their application exposes `/api/auth/oauth2/token` (or the legacy plugins' `/oauth2/token` and `/mcp/token`) as a token endpoint to OAuth/OIDC clients, including internal MCP clients (Claude Desktop, custom MCP tool callers, AI agents). - Their application has not implemented a

    CVE: CVE-2026-53518

  • GHSA-86j7-9j95-vpqjHigh
    Better Auth has stored XSS in the auth-server origin via javascript: redirect_uri in oidc-provider and mcp
    • < 1.6.13
    • >= 1.7.0-beta.0, < 1.7.0-beta.4

    ### Am I affected? Check each condition. Users are affected when all of the first three hold. - Their application enables the `oidc-provider` plugin or the `mcp` plugin from `better-auth/plugins`. The `mcp` plugin wraps the same provider and carries the same defect. Both are on the migration path to `@better-auth/oauth-provider`, which is not affected. - Their application `better-auth` version is `1.6.12` or earlier on the stable line, or any `1.7.0-beta` build on the pre-release line. Both release lines carry the same defect. - Their application consent page is a client component that reads

    CVE: CVE-2026-67333

Showing 1-10 of 27 vulnerabilities