Decode and format SAML assertion payloads for identity analysis.
SAML is an XML-based standard for exchanging authentication and authorization data between an Identity Provider (IdP) (like Okta, Entra ID) and a Service Provider (SP) (like Salesforce, KaruviLab).
It enables Enterprise Single Sign-On (SSO). Instead of creating a password for every app, employees log into the IdP once. The IdP then sends cryptographically signed SAML XML messages to the SPs, telling them "I have authenticated this user, log them in."
SAML relies heavily on XML Digital Signatures to prevent tampering. However, XML parsing is notoriously complex. A classic attack against SAML is XML Signature Wrapping (XSW).
In an XSW attack, a hacker intercepts the SAML Response, duplicates the Assertion, modifies the identity in the unsigned copy (e.g., changing their email to admin@company.com), and tricks the Service Provider's XML parser into verifying the signature on the original assertion but reading the identity from the fake one.
Service Providers must strictly validate the SAML Response to be secure. Common failures include:
NotBefore and NotOnOrAfter, allowing replay attacks of old tokens.In a SAML SSO flow, why is a SAMLRequest usually compressed with DEFLATE before being Base64 encoded?