<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>@Better-Auth/Scim - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/@better-auth/scim/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 24 Jul 2026 15:42:07 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/@better-auth/scim/feed.xml" rel="self" type="application/rss+xml"/><item><title>Account Takeover and Stale Access via SCIM Provider-ID Collision in @better-auth/scim</title><link>https://feed.craftedsignal.io/briefs/2026-07-better-auth-scim-collision/</link><pubDate>Fri, 24 Jul 2026 15:42:07 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-better-auth-scim-collision/</guid><description>The `@better-auth/scim` package is affected by multiple vulnerabilities, including a critical provider-ID collision flaw that allows authenticated users to craft SCIM tokens impersonating existing account providers, leading to unauthorized account access, profile modification, and user deletion, while additional issues include failed user deactivation and email update vulnerabilities bypassing uniqueness checks in versions `1.4.0-beta.27` through `1.6.21` and `1.7.0-beta.0` through `1.7.0-beta.9`.</description><content:encoded><![CDATA[<p>The <code>@better-auth/scim</code> plugin, utilized by applications registering it, is critically vulnerable to multiple flaws, including a provider-ID collision issue (GHSA-rjg6-39jm-rgg4). This vulnerability, affecting versions from <code>1.4.0-beta.27</code> through <code>1.6.21</code> and <code>1.7.0-beta.0</code> through <code>1.7.0-beta.9</code>, allows an authenticated attacker to craft SCIM tokens whose <code>providerId</code> matches an existing SSO, SAML, OIDC, or social provider. This enables unauthorized account access, modification of profile fields, and complete deletion of user accounts not managed by the SCIM token. Additionally, the plugin fails to correctly process <code>active: false</code> deactivation requests, potentially leaving terminated users with continued access, and bypasses email uniqueness checks during updates, leading to data corruption. These issues could lead to significant security breaches, including widespread account takeovers and denial of service for legitimate users.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An authenticated user accesses an application integrated with <code>@better-auth/scim</code> and generates a SCIM bearer token, leveraging either the default <code>canGenerateToken</code> policy or a custom policy vulnerable to <code>providerId</code> collision.</li>
<li>The attacker identifies a legitimate <code>providerId</code> (e.g., from an SSO, SAML, OIDC, or social provider) already in use by other account rows within the application's database.</li>
<li>The attacker crafts the SCIM bearer token or modifies its <code>providerId</code> to explicitly collide with this identified legitimate <code>providerId</code>.</li>
<li>Using this maliciously crafted SCIM token, the attacker sends a <code>DELETE /scim/v2/Users/:id</code> API request to the application, targeting a specific user ID.</li>
<li>The <code>@better-auth/scim</code> plugin, due to the <code>providerId</code> collision, incorrectly maps the request to a global user account associated with the legitimate, colliding provider, even if the SCIM token never provisioned that user.</li>
<li>The application proceeds to delete the global user and their associated sessions, leading to unauthorized account access removal and denial of service for the legitimate user.</li>
<li>Alternatively, the attacker could use <code>PUT</code> or <code>PATCH</code> requests with the crafted token to rewrite global profile fields for SSO-provisioned organization members by leveraging the <code>providerId</code> collision.</li>
<li>Further exploitation includes leveraging the absence of email uniqueness checks in <code>PUT</code> or <code>PATCH</code> updates to assign one user's email to another, potentially corrupting user login and lookup capabilities.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The provider-ID collision issue allows an authenticated attacker to gain unauthorized access to and manipulate user accounts not under the SCIM token's legitimate scope. Attackers can delete global user records, modify profile information for SSO-provisioned organization members, and potentially corrupt email-keyed login data by reassigning email addresses without uniqueness checks. The deactivation flaw means terminated users might retain access, as the <code>active: false</code> attribute is ignored, allowing continued presence in the system even after an identity provider signals deprovisioning. These vulnerabilities pose a critical risk of widespread account takeover, denial of service, and data integrity issues for affected applications.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Immediately upgrade <code>@better-auth/scim</code> to version <code>1.6.22</code> or <code>1.7.0-beta.10</code> to address the <code>providerId</code> collision, deactivation, and email update vulnerabilities.</li>
<li>If immediate upgrade is not possible, configure the <code>canGenerateToken</code> policy to explicitly reject <code>providerId</code> values that match any existing built-in, social, generic OAuth, SSO, SAML, or OIDC account provider IDs in your application.</li>
<li>Restrict the generation of SCIM tokens to only trusted, privileged users to limit exposure to these vulnerabilities.</li>
<li>Audit existing <code>scimProvider</code> rows in your application and remove any rows whose <code>providerId</code> matches another existing account provider namespace.</li>
<li>Avoid relying solely on deactivation reports from your identity provider; manually confirm that deactivated users have lost access, particularly if your identity provider uses <code>active: false</code> for deprovisioning.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>vulnerability</category><category>web-application</category><category>account-takeover</category><category>sso</category></item></channel></rss>