Summary
Prowler's SAML authentication flow relied on the email domain asserted in the SAML response to decide which tenant should receive the final token, instead of strictly binding token issuance to the validated SAML configuration.
An authenticated attacker controlling a SAML IdP could assert a victim-domain email while completing a valid SAML flow for their own domain, leading to SAML and JWT tokens being issued for the wrong tenant and enabling cross-tenant account takeover.
Affected context
This vulnerability arises in deployments of Prowler that:
- Use SAML-based single sign-on for tenant selection and authentication
- Derive tenant identity from user email domains asserted in SAML responses
- Recalculate tenant during ACS (Assertion Consumer Service) completion logic based on
user.emailinstead of a fixed, validated SAML configuration
It typically manifests where multiple tenants share a Prowler instance, and email domain mappings are treated as the primary discriminator for tenant assignment rather than explicit SAML metadata bindings.
Exploit preconditions
- Attack surface: SAML-based login endpoint and ACS flow in Prowler.
- Required access: Ability to authenticate via a controlled SAML Identity Provider (IdP) configured in the system.
- Trigger point: Completion of the SAML authentication flow where the ACS logic issues a SAMLToken and tenant-scoped JWT based on
user.email. - Why exploitation is possible: The ACS finish logic trusts the email domain from the SAML assertion and recomputes tenant choice from that value, instead of strictly binding tenant selection to the validated SAML configuration tied to the IdP. This allows an attacker to assert an email from another tenant's domain while using their own IdP, causing tokens to be issued for the wrong tenant.
Why this happens
The underlying issue is an authentication and authorization design flaw consistent with CWE-287: Improper Authentication.
Prowler's SAML integration implicitly treated the email domain in the SAMLResponse as an authoritative signal for tenant identity and then recomputed tenant assignment at the ACS phase using user.email.
This pattern breaks the association between the SAML configuration (the trusted IdP and its mapped tenant) and the token issuance step, allowing a malicious but validly configured IdP to impersonate accounts in another tenant by asserting cross-tenant email addresses.
Abstractly, the bug is a failure to bind authenticated sessions and tokens to a stable, verified identity context, instead relying on mutable attributes that can be forged within a legitimate SAML assertion.
Potential impact
- Attacker-controlled accounts may gain access to another tenant's Prowler environment.
- Malicious users could view or modify cloud security findings and configurations for victim tenants.
- Cross-tenant data exposure could occur, including compliance reports and security posture details.
- Attackers may manipulate security controls or assessments for victim organizations, undermining trust in the platform.
- Elevated risk of lateral movement if Prowler integrations trigger actions in underlying cloud environments.
General mitigation guidance
Effective mitigation focuses on making tenant binding and authentication flows strict and context-aware, rather than relying on derived attributes like email domains.
Recommended design patterns include:
- Binding tenant identity directly to the trusted SAML configuration and IdP metadata, not to asserted email domains or other mutable attributes.
- Treating SAML attributes as claims that must be validated against a pre-defined mapping and consistency rules before token issuance.
- Ensuring that token generation (SAML tokens, JWTs) is tied to an immutable, validated tenant context established at the beginning of the SSO handshake.
- Implementing explicit checks that the asserted email and domain align with the expected tenant for the configured IdP, failing closed on mismatches.
- Applying least-privilege defaults for any newly created or mapped accounts, and requiring explicit administrative approval for cross-tenant mappings.
These patterns reduce the risk of cross-tenant impersonation even when an attacker controls an IdP or SAML assertions.
How teams detect issues like this
Detecting this class of vulnerability usually involves a mix of code-level and behavioral analysis:
- Static analysis and code review: Look for logic that derives tenant or account identity from email domains or other SAML attributes without tying them to the SAML configuration object. Flag any recalculation of tenant or identity during ACS completion that is not based on previously validated context.
- Authentication flow audits: Review SAML integration code to ensure the IdP-to-tenant mapping is enforced consistently from the start of the SSO flow to token issuance, with no intermediate steps that can override the mapping.
- Logging and anomaly detection: Instrument detailed logs on SAML login events, including IdP identifiers, asserted email addresses, and chosen tenants. Monitor for events where the IdP and tenant mapping appear inconsistent (e.g., an IdP typically associated with one domain producing tokens for another).
- Policy enforcement: Enforce development policies that forbid using email domains as primary tenant discriminators in multi-tenant systems and require explicit security review for SAML mapping logic.
Automated application security testing tools and SSO-specific linters can complement manual review by flagging risky attribute-based routing patterns.

