A Breakdown of the New SAML Authentication Bypass Vulnerability
A SAML authentication bypass vulnerability allows an attacker to insert an XML comment into the NameID element of a SAML assertion, causing some SAML libraries to misparse the username and authenticate as a different user. The vulnerability also exploits weak XML canonicalization that ignores comments, so the tampered assertion still passes signature validation.
developer.okta.com
Published on developer.okta.com
Randall Degges](https://developer.okta.com/blog/authors/randall-degges/)| February 27, 2018 |
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 SAML library's XML parser extracts only the first or last text node from the NameID element, ignoring comments, and the XML signature canonicalization also ignores comments, so a modified assertion with an injected comment still validates.
Impact
An attacker could bypass authentication and assume the role of an authenticated user, potentially gaining unauthorised access to services that rely on SAML for single sign-on.
What the attacker needed
Attacker can craft a SAML assertion; victim uses a vulnerable SAML library; attacker can intercept or modify SAML response
The fix
SAML libraries should remove all XML comments when creating and parsing documents, and should reject any SAML node that contains more than one child node.
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 let you log in using an account from another service, like logging into a site with your company account. This bug lets an attacker sneak a comment into the login data so that the system thinks you are someone else, without breaking the security check. It's like changing the name on a ticket but the ticket still looks valid because the check ignores small marks.
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.