Assertion Consumer Service URL tag not checked for invalid characters when AuthnRequest is signed (CVE-2017-5183)

  • 7018509
  • 23-Jan-2017
  • 31-Jan-2017

Environment

NetIQ Access Manager 4.3
NetIQ Access Manager 4.2
NetIQ Access Manager Identity Server
CVE-2017-5183

Situation

Access Manager 4.2.2 and 4.3 introduced the option to define a SAML Assertion Consumer Service (ACS) whitelist. This ACS whitelist works great when the AuthnRequest is unsigned. When AuthnRequest is signed however, any javascript on the ACS tag is executed, even though the signature validation will fail. The ACS tag must be scanned for any XSS threats. Using the following snippet below, we can see an example of a signed AuthnRequest with XSS code:

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Consent="urn:oasis:names:tc:SAML:2.0:consent:unavailable" Destination="https://nam42sba.lab.novell.com/nidp/saml2/sso" AssertionConsumerServiceURL="javascript:alert(1)//eo926mwh" ForceAuthn="false" ID="idQseqedKLGZSoZHCieltei-q8bTw" IsPassive="false" IssueInstant="2017-01-06T10:21:27Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0"><saml:Issuer>https://nam43sba.dub.novell.com/nidp/saml2/metadata</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
:

We must validate all tags for XSS threats.

Resolution

Fixed in NAM 4.2.3 and 4.3.1+. If a script tag or javascript formatted string is added, IDP throws the error message - 400 Bad request.

Log snippet:
Warning: Invalid resource key: The value of attribute "AssertionConsumerServiceURL" associated with an element type "samlp:AuthnRequest" must not contain the '<' character.. No non-unique key!
Warning: Invalid resource key: The value of attribute "AssertionConsumerServiceURL" associated with an element type "samlp:AuthnRequest" must not contain the '<' character.. No non-unique key!

<amLogEntry> 2017-01-23T06:34:55Z INFO NIDS Application: AM#500105039: AMDEVICEID#EC0861665F8CF4AD: AMAUTHID#446A30FBCB8EC68207DC646EFB861642: Error on session id 446A30FBCB8EC68207DC646EFB861642, error -EC0861665F8CF4AD, Unable to complete request at this time.:The value of attribute "AssertionConsumerServiceURL" associated with an element type "samlp:AuthnRequest" must not contain the '<' character.: </amLogEntry>