CVE-2026-67330
JSON

9.4critical

better-auth SCIM 1.4.0-beta.27 before 1.6.22 Account Takeover via Provider-ID Collision

Severity
9.4critical CVSS:4.0 by VulnCheck
Exploit likelihood
0.60% (higher than 43% of CVEs)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-rjg6-39jm-rgg4

Description

@better-auth/scim (a better-auth plugin) versions >= 1.4.0-beta.27 through <= 1.6.21 and >= 1.7.0-beta.0 through <= 1.7.0-beta.9 contain an authorization bypass. SCIM token issuance did not reject provider IDs already used by existing SSO, SAML, OIDC, generic OAuth, or social account providers, and the same logical provider ID was used for both SCIM provider configuration and account ownership. An authenticated user could mint a SCIM token whose provider ID collided with an existing provider namespace, causing SCIM user routes to resolve account rows the token never provisioned. This allowed listing, reading, updating (including rewriting global profile/email fields without uniqueness checks), and deleting global user accounts and sessions, resulting in account takeover and unauthorized deprovisioning. Fixed in 1.6.22 and 1.7.0-beta.10 (1.7.0-rc.0).

Affected

Product or packageVersionsReported by
better-auth scimfrom 1.4.0-beta.27 before 1.6.22, from 1.7.0-beta.0 before 1.7.0-beta.10CVE List
@better-auth/scim (npm)from 1.4.0-beta.27 before 1.6.22, from 1.7.0-beta.0 before 1.7.0-beta.10GitHub Advisory Database

All scores

VulnCheck9.4critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
VulnCheck9.9critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
GitHub9.9critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-20CWE-639CWE-862

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

@better-auth/scim (a better-auth plugin) versions >= 1.4.0-beta.27 through <= 1.6.21 and >= 1.7.0-beta.0 through <= 1.7.0-beta.9 contain an authorization bypass. SCIM token issuance did not reject provider IDs already used by existing SSO, SAML, OIDC, generic OAuth, or social account providers, and the same logical provider ID was used for both SCIM provider configuration and account ownership. An authenticated user could mint a SCIM token whose provider ID collided with an existing provider namespace, causing SCIM user routes to resolve account rows the token never provisioned. This allowed listing, reading, updating (including rewriting global profile/email fields without uniqueness checks), and deleting global user accounts and sessions, resulting in account takeover and unauthorized deprovisioning. Fixed in 1.6.22 and 1.7.0-beta.10 (1.7.0-rc.0).

GitHub Advisory Database
Am I affected?

You are affected if your application registers the @better-auth/scim plugin and lets authenticated users generate SCIM tokens. The default canGenerateToken policy was affected, and custom policies were affected when they did not reject provider IDs already used by other account providers. The provider-ID collision issue additionally requires SSO, SAML, OIDC, generic OAuth, or social providers whose account rows use custom provider IDs, plus existing account rows under those IDs.

The deprovisioning and email-update issues require only the SCIM plugin and a valid SCIM bearer token. Published versions from @better-auth/scim@1.4.0-beta.27 through 1.6.21 are affected. Beta versions from 1.7.0-beta.0 through 1.7.0-beta.9 are affected. Upgrade to @better-auth/scim@1.6.22 or 1.7.0-beta.10.

Summary

@better-auth/scim used the same logical provider ID for SCIM provider configuration and account ownership. SCIM token issuance did not reject all account-provider namespaces. An authenticated user could therefore mint a SCIM token whose provider ID matched an existing SSO, SAML, OIDC, generic OAuth, or social provider. SCIM user routes then selected account rows by that provider ID and treated those users as SCIM-managed, even when the SCIM token had never provisioned them.

The same write path had 2 additional validation issues. First, SCIM active: false was not modeled, so identity providers could receive a successful response while the user stayed active. Second, SCIM PUT and PATCH updates changed global email addresses without the same uniqueness check used by create, and emailVerified stayed unchanged after an email reassignment.

Details

The SCIM bearer middleware decoded the provider ID from the bearer token and loaded the matching scimProvider row. User listing and user lookup then queried ordinary account rows by account.providerId. This made the provider ID a user-controlled authorization key. If a SCIM token used a provider ID that belonged to SSO, SAML, OIDC, generic OAuth, or another account provider, the SCIM routes could resolve users that the token did not own.

The highest-impact path was non-organization deletion. On affected versions, DELETE /scim/v2/Users/:id for a non-organization SCIM token deleted the global Better Auth user and their sessions after resolving the user through the colliding provider ID. A low-privileged authenticated user could therefore delete users associated with a colliding provider namespace.

Organization-scoped tokens were also affected by the provider-ID collision. If the colliding provider ID matched the organization's SSO or OIDC connection, SCIM PUT or PATCH could resolve an SSO-provisioned organization member and rewrite global profile fields. Before the patch, changing a user's email through SCIM skipped the uniqueness check and left emailVerified unchanged.

SCIM deactivation had a separate failure mode. The SCIM active attribute was missing from the user schemas and PATCH mapping, so active: false was stripped from requests. A standard identity-provider deactivation signal could return success while the user kept their identity, sessions, and access.

Patches

Fixed in @better-auth/scim@1.6.22 and @better-auth/scim@1.7.0-beta.10.

The patch rejects SCIM provider IDs that collide with built-in providers, configured social providers, generic OAuth providers, and SSO provider rows before a token is minted. It also scopes SCIM deletion to the SCIM account link when the user has other identities. The global user is deleted only when the SCIM account is the user's sole linked account.

The patch models the SCIM active attribute. App-level SCIM deactivation maps active: false to the admin plugin's enforced disabled-user state and revokes sessions. If the admin plugin is absent, the request is rejected instead of being silently dropped.

The patch adds the email uniqueness check to SCIM PUT and PATCH updates and resets emailVerified whenever SCIM changes a user's email.

Workarounds

If you cannot upgrade immediately, configure canGenerateToken to reject provider IDs that match any account provider ID used by your application. Include built-in providers, social providers, generic OAuth providers, SSO, SAML, and OIDC provider IDs. Also restrict which users can generate SCIM tokens.

Do not rely on deactivation reports from your identity provider until you have upgraded. Confirm that deactivated users have actually lost access, especially if your identity provider deprovisions through active: false.

If you use SCIM account linking, avoid broad domain-based linking rules. A shared email domain is not proof that a SCIM token may manage a pre-existing user. Prefer organization-membership checks or an explicit application predicate.

Audit existing scimProvider rows and remove any row whose providerId matches another account provider namespace.

Impact

With the provider-ID collision issue, an authenticated attacker could act through a provider namespace they did not own. They could list and read SCIM user resources for users linked to the colliding provider. They could also update profile and account fields and delete global user records on the non-organization path. In organization-scoped deployments, a colliding token could mutate global profile fields for SSO-provisioned organization members.

With the deactivation issue, a terminated user could remain active after an identity provider reported successful deprovisioning through active: false. With the email-update issue, SCIM could assign one user's email to another user on adapters without an enforced unique index. That could corrupt email-keyed login and lookup, while SQL adapters could raise an unhandled adapter error.

Credit

Found through internal validation.

NVD (es)

Las versiones de @better-auth/scim (un plugin de better-auth) >= 1.4.0-beta.27 hasta menor o igual que 1.6.21 y >= 1.7.0-beta.0 hasta menor o igual que 1.7.0-beta.9 contienen un bypass de autorización. La emisión de tokens SCIM no rechazaba IDs de proveedor ya utilizados por proveedores de SSO, SAML, OIDC, OAuth genérico o cuentas sociales existentes, y el mismo ID de proveedor lógico se utilizaba tanto para la configuración del proveedor SCIM como para la propiedad de la cuenta. Un usuario autenticado podía acuñar un token SCIM cuyo ID de proveedor colisionaba con un espacio de nombres de proveedor existente, haciendo que las rutas de usuario SCIM resolvieran filas de cuentas que el token nunca aprovisionó. Esto permitía listar, leer, actualizar (incluyendo la reescritura de campos globales de perfil/correo electrónico sin verificaciones de unicidad), y eliminar cuentas de usuario y sesiones globales, lo que resultaba en la toma de control de cuentas (account takeover) y desaprovisionamiento no autorizado. Corregido en 1.6.22 y 1.7.0-beta.10 (1.7.0-rc.0).

References

Sources

SourceRecordLicence
CVE ListCVE-2026-67330 changed 2026-11-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-rjg6-39jm-rgg4 changed 2026-10-20CC-BY-4.0
NVDCVE-2026-67330 changed 2026-11-20Public domain