The Fragile Lock: Novel Bypasses For SAML Authentication
The paper describes several parser-level inconsistencies in Ruby and PHP SAML libraries that allow an attacker to bypass XML Signature validation and forge a SAML assertion, leading to full authentication bypass. The techniques include attribute pollution, namespace confusion, and a new Void Canonicalization attack that makes the digest of an empty string appear valid.
portswigger.net
Published on portswigger.net
This post shows how to achieve a full authentication bypass in the Ruby and PHP SAML ecosystem by exploiting several parser-level inconsistencies: including attribute pollution, namespace confusion, and a new class of Void Canonicalization attacks. These techniques allow an attacker to completely bypass XML Signature…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the root cause is that signature verification and assertion processing use different XML parsers (REXML and Nokogiri) with inconsistent handling of namespaces and attributes, and canonicalization errors are silently treated as an empty string.
Impact
An attacker could bypass SAML authentication and impersonate a user.
What the attacker needed
Access to any XML signed by the IdP; ability to submit a crafted SAML Response
How it was found
- Obtain any XML document signed with the IdP's private key, such as signed metadata or a signed error response.
- Insert the legitimate signature into an extension point (e.g., Extensions) before the Assertion element.
- Use a reserved xml namespace declaration to hide the legitimate Signature from the SAML processing module while keeping it visible to the signature verifier.
- Place a fake Signature inside the Assertion with a digest value for an empty string.
- Trigger a canonicalization error (e.g., via a relative namespace URI) so the digest is computed over an empty string, making the fake signature valid.
- Submit the forged SAML Response to the Service Provider to authenticate as an arbitrary user.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
SAML is a way for websites to trust a central login service. The login service signs a message saying who you are, and the website checks that signature. The bug is that the part checking the signature and the part reading the message can disagree about which part of the message was signed, so an attacker can slip in a fake identity that still passes the check.
What is OAuth / SSO?
Mistakes in OAuth, OpenID Connect, SAML or token handling that leak codes and tokens or link an attacker's identity to a victim's account.