/

CVE-2026-67331

Severity:

HIGH RISK

(8.3)

Authorization Bypass (CWE-639) in better-auth SCIM

CVE-2026-67331

Deferred

Vulnerability type

Category:

Authorization Bypass / Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Privilege Escalation and Token Compromise

Severity:

HIGH RISK

(8.3)

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

better-auth SCIM improperly associates non-organization SCIM providers with their creators, causing an authorization check failure.

Under these conditions, an authenticated user may manage other users' SCIM providers, including regenerating bearer tokens and authenticating to SCIM APIs with attacker-controlled credentials.

Affected context

This vulnerability arises in deployments using better-auth SCIM versions from 1.5.0 before 1.7.0-beta.4 where SCIM providers are not correctly bound to the creating account by default.

It primarily affects non-organization SCIM providers exposed through authenticated dashboards or management APIs.

Environments where multiple users can manage SCIM configurations and tokens are at higher risk, especially if SCIM endpoints are integrated with provisioning workflows or identity systems.

Exploit preconditions

  • Attack surface: Authenticated web or API interfaces used to configure and manage SCIM providers.
  • Required access: Valid user account on the affected better-auth deployment; no special administrative role is strictly required if the misbinding applies globally.
  • Trigger point: Actions such as viewing, updating, or regenerating SCIM providers or bearer tokens that are not properly tied to the current user.
  • Why exploitation is possible: The system does not consistently enforce ownership checks (object-level authorization) for non-organization SCIM providers, allowing one authenticated user to operate on resources belonging to another user.

Why this happens

The underlying issue is a missing or incomplete object-level authorization check, aligning with CWE-639: Authorization Bypass Through User-Controlled Key.

SCIM provider instances are not strictly bound to their creator or owner when accessed, so the authorization layer relies on the presence of an authenticated session without confirming resource ownership.

This design allows users to indirectly reference or manipulate SCIM providers they do not own, leading to unauthorized token management and control over SCIM integration endpoints.

Potential impact

  • Attackers could regenerate SCIM bearer tokens for other users' providers.
  • Attackers may invalidate legitimate SCIM tokens, disrupting provisioning or deprovisioning flows.
  • Attackers can authenticate to SCIM API routes using attacker-controlled tokens, potentially manipulating user or group data.
  • Provisioning systems relying on SCIM could be misconfigured or poisoned, leading to unauthorized account creation or modification.
  • Audit trails and access control assumptions may be undermined due to cross-user control of SCIM integrations.

General mitigation guidance

Effective mitigation focuses on enforcing strict object-level authorization and reducing the trust placed in user-supplied identifiers.

Common defensive patterns include:

  • Ensuring every SCIM provider and token is strongly associated with an owning principal and that all management operations verify this ownership.
  • Designing resource access APIs so that identifiers are derived from the authenticated context rather than client input wherever possible.
  • Applying least-privilege principles to SCIM management capabilities, limiting which roles can create or modify providers and tokens.
  • Introducing centralized authorization policies that consistently enforce ownership checks across all resource types, including non-organization providers.
  • Implementing defense-in-depth by logging and alerting on unusual cross-account token operations or SCIM configuration changes.

How teams detect issues like this

Organizations can detect similar issues by:

  • Reviewing authorization middleware and controllers for consistent checks that tie SCIM providers and tokens to the authenticated user or appropriate tenant.
  • Using static analysis or linting rules to flag controller endpoints that access provider records without explicit ownership or scope validation.
  • Conducting targeted code reviews focusing on ID-based lookups (e.g., provider IDs) to ensure they are constrained by the current user's scope.
  • Implementing security monitoring that highlights token regeneration events, cross-user access to SCIM resources, and anomalous SCIM API usage patterns.
  • Leveraging automated security testing tools or manual penetration testing to attempt cross-account operations on SCIM configuration endpoints.

Sources

SourceLink
github.comgithub.com/better-auth/better-auth/security/advisories/GHSA-j8v8-g9cx-5qf4
vulncheck.comvulncheck.com/advisories/better-auth-scim-before-beta-4-authorization-bypass

Frequently asked

questions

Exploitation typically requires any valid authenticated account on the affected better-auth SCIM deployment; from there, a user may be able to manage other users' non-organization SCIM providers if ownership checks are missing.

Not necessarily. The issue stems from weak object-level authorization, so even non-admin users may perform actions on SCIM providers they do not own if the system does not enforce proper ownership constraints.

The most robust fix is to enforce strict ownership checks on every operation involving SCIM providers and tokens, ensuring they are always filtered and validated against the current user's identity or tenant scope before any action is taken.

Adopt a consistent access control design that treats every resource as scoped to a specific principal or tenant, enforce object-level checks in shared authorization middleware, and incorporate security reviews and automated tests that explicitly validate cross-user isolation for configuration and token management features.

Find out what's already
exploitable in your codebase.