SAML Injection: XML Comment Handling

OAuth and SSOExploitation

From PayloadsAllTheThings by Swissky and contributors, under the MIT licence. Shown as written; the title and classification are ours. Licences. Its authors can have this tip removed by writing to abuse@bugbountytips.org.

A threat actor who already has authenticated access into a SSO system can authenticate as another user without that individual’s SSO password. This vulnerability has multiple CVE in the following libraries and products.

  • OneLogin - python-saml - CVE-2017-11427

  • OneLogin - ruby-saml - CVE-2017-11428

  • Clever - saml2-js - CVE-2017-11429

  • OmniAuth-SAML - CVE-2017-11430

  • Shibboleth - CVE-2018-0489

  • Duo Network Gateway - CVE-2018-7340

Researchers have noticed that if an attacker inserts a comment inside the username field in such a way that it breaks the username, the attacker might gain access to a legitimate user's account.

xml
<SAMLResponse>
    <Issuer>https://idp.com/</Issuer>
    <Assertion ID="_id1234">
        <Subject>
            <NameID>user@user.com<!--XMLCOMMENT-->.evil.com</NameID>

Where user@user.com is the first part of the username, and .evil.com is the second.

Comments

No comments yet.