CVE-2026-41427: @better auth/oauth provider Unprivileged Users Can Register OAuth Vulnerability

HIGH
Advisory Identifier: GHSA-xr8f-h2gw-9xh6
CWE-863
Published
Advisory Summary

CVE-2026-41427 is a HIGH unprivileged users can register oauth vulnerability (CWE-863: Incorrect Authorization) affecting @better auth/oauth provider libraries in the npm ecosystem. The issue involves unprivileged users can register oauth clients. Remediation is available by upgrading affected packages to version 1.6.5.

CVE-2026-41427 at a Glance

CVE Identifier CVE-2026-41427
GHSA Identifier GHSA-xr8f-h2gw-9xh6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-863: Incorrect Authorization
Affected Product @better auth/oauth provider
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-41427

To remediate this vulnerability, upgrade all affected @better auth/oauth provider dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@better-auth/oauth-provider fixed: 1.6.5
npm install @better-auth/oauth-provider@1.6.5
@better-auth/oauth-provider fixed: Latest secure release
npm install @better-auth/oauth-provider@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @better-auth/oauth-provider

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-41427, inspect your project dependencies using npm:

npm ls @better-auth/oauth-provider

Analyze the terminal output to locate any version of @better auth/oauth provider in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.5), your application is affected.

Note: The npm ls @better-auth/oauth-provider 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In @better auth/oauth provider, 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

### Am I affected? You're affected if all of the following are true: - Using @better-auth/oauth-provider at version specified below - You configured clientPrivileges in the plugin options expecting it to gate who can create OAuth clients - The /oauth2/create-client or /admin/oauth2/create-client endpoints are reachable by authenticated users you don't fully trust If clientPrivileges is not configured, this bug has no security consequence for your deployment --- ### Summary The clientPrivileges option documents a create action, but the OAuth client creation endpoints did not invoke the hook before persisting new clients. Deployments that configured clientPrivileges to restrict client registration were not actually restricted — any authenticated user could reach the create endpoints and register an OAuth client with attacker-chosen redirect URIs and metadata. Non-create operations (read, list, update, delete, rotate) enforced the hook correctly. Only the create path was missing the check. ### Impact - Unauthorized registration of OAuth clients by any authenticated user, under deployments that expected clientPrivileges to block them. - Attacker-controlled redirect_uris on those clients enable phishing flows that present as registered first-party applications. - If the SERVER_ONLY admin creation endpoint is also exposed to low-privilege users (a separate deployment misconfiguration), additional sensitive fields including `skip_consent` become writable. ### Patches Fixed in `@better-auth/oauth-provider@1.6.5` Both create endpoints now call the clientPrivileges hook with action "create" before persisting the client record. ### Workarounds If you cannot upgrade immediately: - Block the /oauth2/create-client and /admin/oauth2/create-client routes at your reverse proxy or middleware layer for any user who should not be able to register clients. - Do not expose the admin creation endpoint (it is SERVER_ONLY by design and should not be reachable by end-user sessions).

CVE-2026-41427 Affected @better auth/oauth provider Versions

2 component(s)
Fixed Versions:
1.6.5
Product / Package Ecosystem Affected Versions Fixed Version
@better-auth/oauth-provider
npm
≥ 1.4.8-beta.7
< 1.6.5
1.6.5
@better-auth/oauth-provider
npm
≥ 1.7.0-beta.0
≤ 1.7.0-beta.1

References

Frequently Asked Questions

What is CVE-2026-41427?
CVE-2026-41427 is a security vulnerability in @better auth/oauth provider involving Unprivileged users can register OAuth clients under CWE-863: Incorrect Authorization.
Which @better auth/oauth provider versions are affected?
Affected versions include releases prior to 1.6.5 across affected packages: @better-auth/oauth-provider.
What version fixes CVE-2026-41427?
Upgrading to 1.6.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @better-auth/oauth-provider affected?
Yes, @better-auth/oauth-provider is affected in releases prior to 1.6.5, Latest secure release. Upgrade your dependency to 1.6.5, Latest secure release or later.
What CWE is associated with CVE-2026-41427?
CVE-2026-41427 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check npm dependencies for CVE-2026-41427?
Run the dependency tree command: 'npm ls @better-auth/oauth-provider'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xr8f-h2gw-9xh6",
  "modified" : "2026-04-27T15:24:29Z",
  "published" : "2026-04-16T22:44:27Z",
  "aliases" : [ "CVE-2026-41427" ],
  "summary" : "OAuth 2.1 Provider: Unprivileged users can register OAuth clients",
  "details" : "### Am I affected?\n\n  You're affected if all of the following are true:\n\n  - Using @better-auth/oauth-provider at version specified below \n  - You configured clientPrivileges in the plugin options expecting it to gate who can create OAuth clients\n  - The /oauth2/create-client or /admin/oauth2/create-client endpoints are reachable by authenticated users you don't fully trust\n\n  If clientPrivileges is not configured, this bug has no security consequence for your deployment\n\n  ---\n  ### Summary\n\n  The clientPrivileges option documents a create action, but the OAuth client creation endpoints did not invoke the hook before persisting new clients. Deployments that configured clientPrivileges to restrict client registration were not actually restricted — any authenticated user could reach the create endpoints and register an OAuth client with attacker-chosen redirect URIs and metadata.\n\n Non-create operations (read, list, update, delete, rotate) enforced the hook correctly. Only the create path was missing the check.\n\n### Impact\n\n  - Unauthorized registration of OAuth clients by any authenticated user, under deployments that expected clientPrivileges to block them.\n  - Attacker-controlled redirect_uris on those clients enable phishing flows that present as registered first-party applications.\n  - If the SERVER_ONLY admin creation endpoint is also exposed to low-privilege users (a separate deployment misconfiguration), additional sensitive fields including `skip_consent` become writable.\n\n### Patches\n\nFixed in `@better-auth/oauth-provider@1.6.5` Both create endpoints now call the clientPrivileges hook with action \"create\" before persisting the client record.\n\n### Workarounds\n\n  If you cannot upgrade immediately:\n\n  - Block the /oauth2/create-client and /admin/oauth2/create-client routes at your reverse proxy or middleware layer for any user who should not be able to register clients.\n  - Do not expose the admin creation endpoint (it is SERVER_ONLY by design and should not be reachable by end-user sessions).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:H/VA:N/SC:L/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@better-auth/oauth-provider"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.8-beta.7"
      }, {
        "fixed" : "1.6.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@better-auth/oauth-provider"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.0-beta.0"
      }, {
        "last_affected" : "1.7.0-beta.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-xr8f-h2gw-9xh6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41427"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/better-auth/better-auth"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-16T22:44:27Z",
    "nvd_published_at" : "2026-04-24T20:16:27Z"
  }
}