SAML 2.0 Security Vulnerability & Exploitation Laboratory
Interactive vulnerability simulator demonstrating real-world SAML attacks: XML Signature Wrapping (XSW), Token Replay, XML External Entity (XXE) injection, Comment Truncation (CVE-2018-0489), and Certificate Spoofing.
🔬 Live SAML Attack Simulation Console
Select a crafted adversary payload to inject against the NTMS Service Provider verification pipeline:
XML Signature Wrapping (XSW-3)
The SP verified that the signed DOM element URI exactly matches the root Assertion consumed by the authorization engine. Unsigned root assertions are rejected.
Comprehensive Technical Breakdown: Top 6 SAML Exploits
How adversaries exploit architectural and parser flaws in SAML implementations, and how modern identity providers neutralize them.
1. XML Signature Wrapping (XSW)
Exploits discrepancies between the XMLDSig verification module and the application business logic.
Defense: Ensure the signature validator returns the exact DOM node verified, and consume only that node for identity claims.
2. SAML Assertion Replay Attack
Attacker intercepts an employee's valid SAMLResponse and re-posts it later to establish a valid session.
Defense: SP must cache consumed Assertion IDs in Redis/Memory until their NotOnOrAfter timestamp expires.
3. XML External Entity (XXE) Injection
Attacker inserts a DOCTYPE with external entities into the SAML XML to exfiltrate files or trigger SSRF.
Defense: Completely disable DTD processing and external entity resolution in XML parser libraries.
4. Comment Truncation Attack
Exploited in major SAML libraries (Duo, OneLogin). Inserting XML comments caused parsers to truncate username strings.
Defense: Concatenate all adjacent text nodes under the NameID element rather than relying on firstChild.nodeValue.
5. Rogue Cert & Signature Stripping
Attacker creates self-signed X.509 cert and places it in <ds:KeyInfo>, or strips signatures entirely.
Defense: Pin the authentic Microsoft Entra ID certificate (NTMS-APP-SAML.cer) and reject any untrusted signer.
6. Open Redirect via RelayState
Attacker tampers with the RelayState parameter to bounce user to a malicious credential-harvesting phishing page.
Defense: Whitelist internal relative paths only (e.g., must begin with / and forbid external schemes).