Summary
An access control flaw in Capgo's SSO prelink endpoint lets enterprise administrators delete password-based identities for users in other organizations that share the same email domain.
With org.update_settings permission and an active SSO provider, an attacker can strip email authentication from foreign accounts, forcing victims onto the attacker's SSO provider or into password recovery flows.
Affected context
This vulnerability arises in Capgo deployments that:
- Use enterprise SSO with domain-based identity mapping
- Expose the SSO prelink-users endpoint to administrators with org.update_settings permission
- Do not fully isolate identity operations by organization boundary when acting on shared email domains
It primarily affects environments where multiple organizations share the same email domain (or overlapping identity domains), and where administrative controls can impact identities outside the administrator's own organization.
Exploit preconditions
- Attack surface: Capgo backend SSO prelink-users endpoint
- Required access:
- Valid authenticated administrator account in one organization
- org.update_settings (or equivalent) permission
- An active and configured SSO provider bound to an email domain
- Trigger point:
- Calling the SSO prelink-users endpoint targeting accounts whose email addresses match the SSO provider's domain, including users belonging to other organizations
- Why exploitation is possible:
- The endpoint enforces permission checks on the caller's role but does not sufficiently validate organizational ownership of affected identities.
- Domain-based identity linkage is treated as a sufficient authorization scope, allowing cross-organization modifications of users sharing the same email domain.
Why this happens
The root cause is a broken authorization boundary when performing identity management actions tied to SSO configuration (CWE-285: Improper Authorization).
The SSO prelink endpoint appears to rely on email domain or SSO provider association as an implicit trust boundary instead of explicitly validating that each affected user belongs to the administrator's own organization.
This conflation of authentication attributes (email domain / SSO mapping) with authorization scope allows an administrator in one organization to perform destructive operations—deleting password identities—on users in foreign organizations that share the same domain.
Potential impact
- Forced migration of victim accounts to the attacker-controlled SSO provider
- Permanent loss of email/password login for affected users
- Lockout or disruption of access for users in other organizations until they complete account recovery
- Undermining of organization-level isolation and trust boundaries in multi-tenant deployments
- Potential for targeted account disruption against specific users or teams sharing an email domain
General mitigation guidance
Effective mitigation centers on tightening authorization boundaries around identity operations and SSO configuration:
- Enforce strict organization ownership checks for all identity-modifying endpoints, especially those acting on multiple users or domain-based queries.
- Decouple email domain matching from authorization scope; treat domain overlap as informational, not as a permission boundary.
- Require that bulk identity operations explicitly verify that each user belongs to the caller's organization before modifications are applied.
- Introduce least-privilege administrative roles, separating SSO configuration from destructive identity operations where possible.
- Implement preventative controls such as confirmation prompts, scoping filters, and change previews for bulk or cross-domain identity changes.
- Apply defense-in-depth through multi-tenant isolation patterns, ensuring that organization-specific resources and identities cannot be modified by foreign administrators even when domains overlap.
How teams detect issues like this
Detection efforts should focus on both code-level issues and runtime behavior:
- Code review and design analysis:
- Examine identity and SSO endpoints for authorization logic that relies on email domain, SSO provider association, or other indirect attributes instead of explicit organization membership checks.
- Review multi-tenant boundaries to ensure that every mutating operation includes a validated organization scope parameter and ownership check.
- Static analysis patterns:
- Flag endpoints that perform bulk user or identity updates based on filters like email domain or provider ID without verifying tenant ownership.
- Identify uses of administrative permissions that are not combined with explicit organization scoping.
- Runtime monitoring and logging:
- Log all calls to SSO prelink and identity-modifying endpoints with fields for actor organization, target organization, email domain, and counts of affected users.
- Create alerts for:
- Cross-organization modifications (actor org ≠ target org)
- Unusually large batches of password identity deletions or SSO linking events.
- Automated review tools:
- Integrate security linters or policy-as-code checks in CI/CD to prevent introduction of new endpoints that modify identities without clear tenant scoping.

