Summary
Sentry's SAML SSO implementation in versions 21.12.0 through 26.1.0 contains an authentication flaw that enables account takeover when abused through a malicious SAML Identity Provider in a multi-organization setup.
Under specific configuration and permission conditions, an attacker can complete SSO as another user and assume their Sentry account without needing that user's credentials.
Affected context
This vulnerability affects self-hosted Sentry instances that use SAML-based Single Sign-On and support multiple organizations on the same deployment.
It becomes relevant when:
- SAML SSO is enabled for one or more organizations, and
- The instance hosts more than one organization, and either:
- The deployment is configured for multiple organizations (i.e., not strictly single-organization), or
- An attacker already has access and permissions to modify SSO settings for another organization.
In these conditions, a malicious or compromised SAML Identity Provider can be leveraged to bind SAML assertions to arbitrary user accounts on the instance.
Exploit preconditions
- Attack surface: Sentry's SAML SSO login endpoints on a self-hosted instance.
- Required access:
- Ability to operate or control a malicious SAML Identity Provider, and
- Either:
- The Sentry instance hosts multiple organizations, or
- The attacker already has sufficient permissions to change SSO settings for at least one organization on that instance.
- Trigger point: Initiating a SAML SSO login flow targeting a vulnerable organization while presenting crafted SAML assertions from the malicious IdP.
- Why exploitation is possible: The SAML SSO implementation does not adequately bind SAML assertions and organization/IdP configuration to the intended user identity, allowing a malicious IdP in the same instance context to be used to authenticate as another user's account.
Why this happens
The issue stems from improper authentication logic in the SAML SSO flow, aligning with CWE-287: Improper Authentication.
The Sentry SAML implementation does not tightly validate that:
- The SAML assertion's identity and attributes are strictly bound to a single, trusted IdP configuration for a given organization, and
- The authenticated identity cannot be mapped across organizations in a way that permits reuse or confusion of identities.
This weak binding between SAML assertions, organization context, and user accounts allows a malicious IdP controlled for one organization to influence or override account mappings for users in another organization on the same Sentry instance.
Potential impact
- Attacker may take over arbitrary user accounts on the affected Sentry instance.
- Attacker could gain access to sensitive error and performance data, including stack traces, logs, and possibly secrets present in captured events.
- Attacker can modify project configuration, alert rules, and integrations from a compromised account.
- Attacker may escalate to administrative control if high-privilege accounts are taken over.
- Attacker can impersonate users to perform destructive actions, such as altering settings or deleting projects and organizations.
General mitigation guidance
Effective mitigation focuses on strengthening identity binding, SSO configuration isolation, and user-level defenses:
- Ensure SAML authentication logic strictly associates each SAML assertion with a single trusted IdP configuration per organization and validates all relevant attributes (e.g., unique identifiers, audience, issuer).
- Enforce strict separation between organizations' SSO configurations so that one organization's IdP cannot influence authentication for another.
- Reduce reliance on SSO alone by enabling per-user multi-factor authentication so that account takeover attempts via SAML require an additional factor.
- Limit who can configure or modify SSO settings to narrowly scoped administrative roles and apply least-privilege principles.
- Regularly review SSO and identity provider configurations to ensure they match expected domains, identifiers, and trust relationships.
How teams detect issues like this
Organizations can use several approaches to detect and monitor for this class of SSO authentication issues:
- Configuration review: Periodically audit SAML configuration across organizations to ensure each organization is bound to the correct IdP and that there is no cross-organization reuse of identifiers or endpoints.
- Log and telemetry analysis: Monitor authentication logs for unusual SAML SSO activity, such as:
- Logins for a user from an unexpected IdP configuration or organization.
- Sudden changes to SSO or IdP settings followed by multiple logins.
- Static and code-level review: For custom or self-maintained SSO logic, review:
- How SAML assertions are validated (issuer, audience, signatures, NameID, and attributes).
- How user accounts are resolved and created from SAML attributes, ensuring organization-specific scoping.
- Policy and tooling: Use security review tools and CI policies to flag unsafe authentication patterns, such as identity mapping that does not include explicit tenant/organization scoping or relies solely on mutable identifiers (e.g., email) without stable unique IDs.

