7.1high
Better Auth OAuth 2.1 Provider: Unprivileged users can register OAuth clients
- Severity
- 7.1high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.22% (higher than 13% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-xr8f-h2gw-9xh6
Description
Better Auth is an authentication and authorization library for TypeScript. Prior to 1.6.5, 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. This vulnerability is fixed in 1.6.5.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| better-auth better-auth | >= 1.4.8-beta.7, < 1.6.5, >= 1.7.0-beta.0, <= 1.7.0-beta.1 | CVE List |
| better-auth oauth-provider | >= 1.4.8-beta.7, < 1.6.5, >= 1.7.0-beta.0, <= 1.7.0-beta.1 | CVE List |
| @better-auth/oauth-provider (npm) | from 1.4.8-beta.7 before 1.6.5, from 1.7.0-beta.0 up to 1.7.0-beta.1 | GitHub Advisory Database |
| better-auth better-auth/oauth-provider | from 1.4.9 before 1.6.5, 1.4.8, 1.7.0 | NVD |
All scores
| GitHub_M | 7.1high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:L/SA:N |
| GitHub | high CVSS:4.0 | 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 |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Better Auth is an authentication and authorization library for TypeScript. Prior to 1.6.5, 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. This vulnerability is fixed in 1.6.5.
GitHub Advisory Database
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_consentbecome 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).
NVD (es)
Better Auth es una biblioteca de autenticación y autorización para TypeScript. Antes de 1.6.5, la opción clientPrivileges documenta una acción de creación, pero los puntos finales de creación de clientes OAuth no invocaban el ’hook’ antes de persistir nuevos clientes. Las implementaciones que configuraron clientPrivileges para restringir el registro de clientes no estaban realmente restringidas - cualquier usuario autenticado podía acceder a los puntos finales de creación y registrar un cliente OAuth con URIs de redirección y metadatos elegidos por el atacante. Esta vulnerabilidad está corregida en 1.6.5.
References
| https://github.com/better-auth/better-auth/security/advisories/GHSA-xr8f-h2gw-9xh6 | mitigation, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-41427 | advisory | |
| https://github.com/better-auth/better-auth | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-41427 changed 2026-04-27 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-xr8f-h2gw-9xh6 changed 2026-05-05 | CC-BY-4.0 |
| NVD | CVE-2026-41427 changed 2026-10-26 | Public domain |