/

CVE-2026-53515

Severity:

HIGH RISK

(7.1)

Access Control Flaw (CWE-269) in Better Auth SSO Plugin

CVE-2026-53515

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-269, CWE-285, CWE-863

Impact:

Privilege Escalation and Unauthorized SSO Configuration

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A broken access control issue in the Better Auth SSO plugin allows any organization member to register new SSO providers via the /sso/register endpoint without requiring owner or admin privileges.

If an attacker-controlled OIDC or SAML provider is attached, its /sso/callback/{providerId} flow can be abused to influence organization provisioning and membership, potentially escalating privileges or onboarding unauthorized identities.

Affected context

The vulnerability affects applications using the @better-auth/sso plugin for TypeScript-based Better Auth deployments between versions 1.2.10 and 1.6.11.

It arises in multi-user organizations where the /sso/register endpoint is exposed to logged-in members and the system treats SSO configuration as an administrative operation.

Environments that rely on OIDC or SAML integration for automated provisioning and sign-in are particularly exposed, as SSO provider configuration directly drives identity onboarding.

Exploit preconditions

  • Attack surface: Application backend endpoint POST /sso/register exposed via Better Auth SSO integration
  • Required access: Authenticated membership in the target organization (not necessarily admin or owner)
  • Trigger point: Sending a crafted registration request to attach an attacker-controlled OIDC or SAML provider to the organization
  • Why exploitation is possible: The registerSSOProvider logic checks only for an organization membership record and does not enforce role-based authorization, allowing non-privileged users to perform administrative SSO configuration actions

Why this happens

The core issue is an authorization design flaw where a sensitive administrative operation—registering SSO providers for an organization—is gated solely by membership, not by appropriate roles or privileges.

This maps to CWE-269: Improper Privilege Management and CWE-285: Improper Authorization, where operations that should be restricted to high-privilege users are available to any authenticated member.

Conceptually, the code treats "is user in organization?" as sufficient to perform configuration changes, rather than enforcing a stricter policy such as "is organization owner or admin?" for SSO provider registration.

Potential impact

  • An attacker who is a regular organization member may register an attacker-controlled OIDC or SAML provider.
  • The attacker-controlled SSO provider could be used to onboard arbitrary accounts into the organization.
  • Organization provisioning flows may be manipulated, potentially granting broader access than intended.
  • SSO trust relationships can be subverted, undermining the integrity of identity and access management.
  • Auditability and accountability of organization membership may be degraded due to uncontrolled SSO configuration.

General mitigation guidance

Effective mitigation focuses on enforcing strict authorization boundaries around SSO configuration and other administrative actions.

Common defensive patterns include:

  • Applying role-based access control (RBAC) checks to all endpoints that modify authentication, SSO, or organization-level settings, ensuring only owners or admins can register or modify SSO providers.
  • Centralizing authorization decisions so that sensitive operations consistently use well-defined policies instead of ad hoc membership checks.
  • Treating identity provider and SSO configuration as high-trust operations that require explicit elevation (e.g., admin-only routes or step-up authentication).
  • Logging and monitoring changes to SSO configuration, and limiting which roles are allowed to manage identity provider settings.
  • Designing APIs so that organization-wide security settings are never modifiable by users with default or minimal roles.

How teams detect issues like this

Detection typically involves a mix of code-level and behavioral analysis:

  • Static analysis and code review: Search for routes and handlers that change organization or SSO configuration and verify they enforce role checks beyond simple membership. Look for patterns like if (isMember) without further privilege validation.
  • Authorization policy validation: Maintain a mapping of high-risk actions (e.g., SSO registration, identity provider changes, organization-wide settings) and ensure tests assert that only privileged roles can invoke them.
  • Runtime monitoring: Instrument logging around /sso/register and related endpoints to detect unusual patterns, such as non-admin users registering new SSO providers or sudden spikes in provider changes.
  • Automated security testing: Use integration tests or security scanners that simulate lower-privilege users attempting to access administrative endpoints to catch regression in access control logic.

Sources

SourceLink
github.comgithub.com/better-auth/better-auth/commit/86765f1597378f5c3deed1b80ca91faac0a6bf00
github.comgithub.com/better-auth/better-auth/pull/9220
github.comgithub.com/better-auth/better-auth/releases/tag/v1.6.11
github.comgithub.com/better-auth/better-auth/security/advisories/GHSA-gv74-j8m3-fg5f

Frequently asked

questions

Yes, but only by users who are already members of the target organization. Any such member who can invoke the /sso/register endpoint over the network could abuse the flaw if additional controls are not in place.

The attacker needs valid credentials for an account that is a member of the organization. They do not need owner or admin privileges; basic membership is sufficient under the vulnerable design.

The robust fix is to enforce strict role checks for SSO registration and related configuration operations, limiting them to owner or admin roles and centralizing those authorization checks so they cannot be bypassed.

Adopt a clear RBAC model, classify high-risk operations (like SSO and identity provider management), enforce least privilege for those operations in code and tests, and perform regular reviews of all endpoints that mutate organization-wide security settings.

Find out what's already
exploitable in your codebase.