Skip to content

[GHSA-xr8f-h2gw-9xh6] OAuth 2.1 Provider: Unprivileged users can register OAuth clients - #10480

Open
mikeflame wants to merge 1 commit into
mikeflame/advisory-improvement-10480from
mikeflame-GHSA-xr8f-h2gw-9xh6
Open

mikeflame wants to merge 1 commit into
mikeflame/advisory-improvement-10480from
mikeflame-GHSA-xr8f-h2gw-9xh6

Conversation

@mikeflame

Copy link
Copy Markdown

Updates

  • Affected products
  • Description
  • References

Comments
The second range has no patched version. @better-auth/[email protected] is on npm (published 2026-04-22, after this advisory was published on 2026-04-16) and contains the same fix as 1.6.5. The repository advisory already lists this range as < 1.7.0-beta.2, patched 1.7.0-beta.2. The set of affected versions does not change, because no npm version exists between 1.7.0-beta.1 and 1.7.0-beta.2.

I ran a minimal check based on the advisory text against the published npm packages: clientPrivileges returns false for every action, and a signed-in user sends POST /oauth2/create-client with an arbitrary redirect_uris.

@better-auth/oauth-provider HTTP status clientPrivileges called with client stored
1.6.4 200 (not called) yes
1.6.5 401 create no
1.7.0-beta.1 200 (not called) yes
1.7.0-beta.2 401 create no
1.7.6 (latest) 401 create no

The 1.7.0-beta.2 changelog does not mention this fix, because the changeset was consumed by the 1.6.5 release on main before the sync. The code and the tarball show that the fix is included.

@github

github commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Hi there @gustavovalverde! A community member has suggested an improvement to your security advisory. If approved, this change will affect the global advisory listed at github.com/advisories. It will not affect the version listed in your project repository.

This change will be reviewed by our Security Curation Team. If you have thoughts or feedback, please share them in a comment here! If this PR has already been closed, you can start a new community contribution for this advisory

Copilot AI max review requested due to automatic review settings October 21, 2026 18:36
@github-actions
github-actions Bot changed the base branch from main to mikeflame/advisory-improvement-10480 October 21, 2026 18:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Upstream evidence supports the version correction, and the remaining wording issue is non-blocking.

1 open issue
What changed in this PR

Updates the OAuth-provider advisory to identify the first patched release in the 1.7 beta line.

Changes:

  • Records 1.7.0-beta.2 as the fixed version and updates the patch description.
  • Adds references to the fixing commit and beta release.
File Description
advisories/​github-reviewed/​2026/​04/​GHSA-xr8f-h2gw-9xh6/​GHSA-xr8f-h2gw-9xh6.json Updates the patched-version boundary, description, and references.

Review effort: Max

],
"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/[email protected]` 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).",
"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/[email protected]` and, for the 1.7.0 beta line, `1.7.0-beta.2`. Both create endpoints\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).",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants