File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,7 @@ def verify!
1818 def location
1919 @location ||= if !signature . missing?
2020 verify_signature!
21-
22- if signature . references . any?
23- "//saml:Assertion[@ID='#{ signature . references . first . uri } ']"
24- else
25- raise SignatureError . new ( "Missing references inside checked signature" )
26- end
21+ "//saml:Assertion[@ID='#{ signature . references . first . uri } ']"
2722 else
2823 DEFAULT_LOCATION
2924 end
Original file line number Diff line number Diff line change 2020 end
2121 end
2222
23+ describe "#location" do
24+ it "should return proper assertion location" do
25+ assert_equal "//saml:Assertion[@ID='samlr456']" , subject . assertion . location
26+ end
27+ end
28+
2329 describe "XSW attack" do
2430 it "should not validate if SAML response is hacked" do
2531 document = saml_response_document ( :certificate => TEST_CERTIFICATE )
3541 response_signature . add_next_sibling ( extensions )
3642 response_signature . remove ( )
3743
38- modified_document . xpath ( "/samlp:Response/samlp:Extensions/saml:Assertion/ds:Signature" , Samlr ::NS_MAP ) . remove ( )
44+ modified_document . xpath ( "/samlp:Response/samlp:Extensions/saml:Assertion/ds:Signature" , Samlr ::NS_MAP ) . remove
3945 modified_document . xpath ( "/samlp:Response/saml:Assertion/saml:Subject/saml:NameID" , Samlr ::
NS_MAP ) . first . content = "[email protected] " 4046 modified_document . xpath ( "/samlp:Response/saml:Assertion" , Samlr ::NS_MAP ) . first [ "ID" ] = "evil_id"
4147
You can’t perform that action at this time.
0 commit comments