Lion Cipher Lab

Forge a SAML assertion with XML Signature Wrapping (XSW) — and stop it

Why it matters

Single sign-on is the front door to everything, which makes the Service Provider's signature check one of the highest-value targets in an org. SAML's whole security rests on one idea: the SP trusts a user identity because an XML signature over the assertion validates against the Identity Provider's certificate. XML Signature Wrapping breaks that trust without ever breaking the signature. The attacker leaves the original signed assertion completely intact — so the crypto still checks out — and injects a SECOND, unsigned assertion positioned so the application's own lookup…

What you'll learn

Steps in this lab

  1. The SAML trust model, in plain terms
  2. The bug class: XML Signature Wrapping (XSW)
  3. Set up your own throwaway IdP (authorized, local, disposable)
  4. Build and sign a legitimate assertion for alice
  5. Write the deliberately-naive Service Provider
  6. The attack: wrap the response and become admin
  7. The fix: validate and consume the SAME node
  8. How professionals ship this: don't hand-roll it
  9. The judgment: why this class is worth remembering

Open the full interactive lab →