Summary
A SAML validation flaw in SuperTokens Core can allow an attacker to authenticate as an identity-provider user without the relevant assertion satisfying the target deployment's audience check. This can occur in licensed deployments with a configured SAML client when an attacker has suitable valid IdP-signed assertions, or when an assertion issued for another deployment is accepted due to a shared default service-provider entity ID.
Affected context
The issue affects licensed SuperTokens Core deployments with a configured SAML client in the affected release ranges. One variant involves assertion-level signing and multiple assertions, where audience validation and claim extraction can rely on different assertions; response-level signing does not expose that variant. Separately, an assertion for another SuperTokens deployment may pass the audience check when deployments share the default saml_sp_entity_id.
Exploit preconditions
- Attack surface: SAML authentication for a configured client in a licensed deployment
- Required access: The attacker needs suitable valid assertions signed by the relevant identity provider, or an assertion issued to another deployment that shares the default service-provider entity ID
- Trigger point: The target deployment processes and validates the SAML response
- Why exploitation is possible: Audience validation may accept an audience from one assertion while authentication claims are extracted from another, or a shared default entity ID may make an assertion intended for another deployment appear to match the target
Why this happens
The authentication flow does not consistently bind the assertion used to satisfy audience validation to the assertion supplying the authenticated identity's NameID and attributes. This is an authentication-verification weakness associated with CWE-287: Improper Authentication and CWE-345: Insufficient Verification of Data Authenticity. Reusing a default service-provider entity ID across deployments can also weaken the separation between their intended SAML audiences.
Potential impact
- An attacker may be authenticated as a victim IdP user
- The attacker could gain access to resources available to that user
- An affected deployment may experience unauthorized actions or exposure of user data
General mitigation guidance
Defensive patterns include binding audience validation and identity-claim extraction to the same verified assertion, and rejecting ambiguous or inconsistent multi-assertion responses. Deployments can use unique, explicitly configured service-provider entity IDs and strict SAML response validation rather than relying on shared defaults. Limiting the privileges of authenticated accounts and applying least-privilege access controls can reduce potential impact if an identity is misattributed.
How teams detect issues like this
Review SAML validation paths to confirm that the audience, signature, issuer, and extracted identity claims all refer to the same verified assertion. Use static analysis and code review to look for validation and claim-extraction logic that selects from different assertions, as well as shared or implicit service-provider entity IDs. Runtime monitoring can flag unexpected audiences, duplicate or multiple assertions, and authentication events inconsistent with expected identity-provider and deployment mappings. Policy checks can require unique entity IDs and strict SAML validation settings.

