CVE-2026-59151: CWE-287: Improper Authentication in prowler-cloud prowler
Description
## SAML Tenant Binding Enables Cross-Tenant Account Takeover ### Summary Prowler's SAML authentication flow trusted the email domain asserted in a SAMLResponse when deciding which tenant should receive the final token. A malicious tenant with its own SAML configuration and a self-controlled IdP could complete a valid SAML flow for its own configured domain, while asserting an email address from another configured domain. In the vulnerable flow, the ACS finish logic later derived the tenant from the asserted email domain instead of binding token issuance to the tenant associated with the validated SAML configuration. This could cause a token to be issued for the wrong tenant. The attacker does not generally need to claim the victim's email domain. If the victim tenant already has SAML configured for that domain, another tenant cannot claim it because `SAMLConfiguration.email_domain` and `SAMLDomainIndex.email_domain` are globally unique. ### Details The confirmed root cause is in the SAML ACS finish and token issuance flow. The flow selected a SAML configuration through the ACS route, but later recalculated the tenant from the asserted user email domain: ```python email_domain = user.email.split("@")[-1] tenant = ( SAMLConfiguration.objects.using(MainRouter.admin_db) .get(email_domain=email_domain) .tenant ) ``` This is unsafe because `user.email` is derived from the SAML assertion. The tenant used for membership updates and token issuance must come from the SAML configuration validated for the current ACS route, not from the asserted email domain. The attack is made possible by several compounding weaknesses: 1. **No domain ownership proof** (`api/src/backend/api/models.py:2100, 2130-2152`): `SAMLConfiguration.email_domain` is validated for format and global uniqueness, but not for domain ownership. Any authenticated tenant admin can claim an unclaimed domain string, but cannot claim a domain already configured by another tenant. 2. **Global SAML domain index** (`api/src/backend/api/models.py:2200-2201`): `SAMLDomainIndex.update_or_create(email_domain=self.email_domain, defaults={'tenant': self.tenant})` maps each configured domain to its tenant. If token issuance later trusts the asserted email domain, it can resolve a tenant different from the one selected by the ACS route. 3. **Hardcoded auto-connect** (`api/src/backend/config/settings/social_login.py:23, 25`): `SOCIALACCOUNT_EMAIL_AUTHENTICATION = True` and `SOCIALACCOUNT_EMAIL_AUTHENTICATION_AUTO_CONNECT = True` are hardcoded and cannot be disabled at runtime. 4. **IdP-initiated SSO enabled** (`api/src/backend/config/settings/social_login.py:78`): `reject_idp_initiated_sso: False` allows the attacker to initiate the flow without requiring any action from the victim. 5. **Token issuance for the wrong tenant** (`api/src/backend/api/v1/views.py:853-873`): after SAML authentication, the vulnerable ACS finish flow could create membership and issue a `SAMLToken` using a tenant derived from the asserted email domain instead of the validated SAML configuration. 6. **Token switch impact** (`api/src/backend/api/v1/serializers.py:272`): the token switch endpoint checks that the authenticated user is a member of the target tenant. If the attacker obtains a JWT for the victim user, they can switch into tenants where that user is already a member. ### PoC **Environment setup:** ```bash # Build the PoC Docker image (build context = repo root) docker build -t vuln001-poc -f vuln-001/Dockerfile . # Start the stack (PostgreSQL + PoC runner) docker compose -f vuln-001/docker-compose-poc.yml up --no-build --abort-on-container-exit ``` **Automated test (runs inside the container):** ```bash python -m pytest poc_vuln001.py -v -s --no-header --tb=short ``` **Manual HTTP exploitation chain (against a live Prowler API):** **Step 1 - Attacker configures SAML for their own email domain:** ```bash curl -i -X POST "$API/api/v1/saml-config" \ -H "Authorization: Bearer $ATTACKER_TOKEN" \ -H "Content-Type: application/vnd.api+json" \ --data '{ "data":{"type":"saml-configurations","attributes":{ "email_domain":"attacker.com", "metadata_xml":"<md:EntityDescriptor entityID=\"evil-idp\" xmlns:md=\"urn:oasis:names:tc:SAML:2.0:metadata\">...attacker cert and SSO URL...</md:EntityDescriptor>" }} }' ``` The attacker does not need to claim `victim.com`. If `victim.com` is already configured by the victim tenant, the attacker cannot claim it because SAML domains are globally unique. **Step 2 - Attacker posts a signed SAMLResponse asserting `[email protected]`:** ```bash # SIGNED_ASSERTION is a base64-encoded SAMLResponse signed with the attacker's private key, # valid for the attacker's configured IdP, but asserting NameID = [email protected] curl -i -L -c c.jar -b c.jar \ -X POST "$API/api/v1/accounts/saml/attacker.com/acs/" \ --data-urlencode "SAMLResponse=$SIGNED_ASSERTION" ``` **Step 3 - Vulnerable ACS finish logic derives
CVSS v3.1
Score 9.6critical
Affected software
prowler-cloud
prowler
pkg:github/prowler-cloud/prowlerRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Prowler's SAML authentication flow prior to version 5.30.3 improperly trusts the email domain asserted in the SAMLResponse to determine tenant assignment. The ACS finish logic recalculates the tenant from user.email rather than binding token issuance to the validated SAML configuration. An attacker with control over a SAML Identity Provider (IdP) can complete a valid SAML flow for an attacker-controlled domain while asserting an email from another tenant's domain. This causes issuance of a SAML token and tenant-scoped JWT for the wrong tenant, enabling cross-tenant account takeover. The vulnerability is addressed in prowler 5.30.3.
Potential Impact
An authenticated attacker controlling a SAML IdP can exploit this vulnerability to obtain authentication tokens scoped to a tenant they do not belong to, resulting in cross-tenant account takeover. This compromises confidentiality and integrity of tenant data. The CVSS 3.1 score is 9.6 (critical), reflecting network attack vector, low attack complexity, privileges required, no user interaction, scope change, and high impact on confidentiality and integrity.
Mitigation Recommendations
Upgrade prowler to version 5.30.3 or later, where this improper authentication vulnerability is fixed. No other mitigations are indicated. Patch status is confirmed by the vendor stating the fix is in 5.30.3.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-07-02T16:50:27.886Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a513aee68715ace43ff0a8a
Added to database: 07/10/2026, 18:33:18 UTC
Last enriched: 07/18/2026, 15:31:06 UTC
Last updated: 10/08/2026, 18:48:47 UTC
Views: 143
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.