Skip to content

Commit 33b92fb

Browse files
sgramponeBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:assertion_manipulation_attack' into beta
1 parent 3bb2d31 commit 33b92fb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

gamsaml20/src/main/java/com/genexus/saml20/PostBinding.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public boolean verifySignatures(SamlParms parms) {
4747
return false;
4848
}else {
4949
this.verifiedDoc = SamlAssertionUtils.loadDocument(verified);
50-
this.xmlDoc = null;
51-
logger.debug(MessageFormat.format("verifySignatures sanitized xmlDoc {0}", Encoding.documentToString(this.xmlDoc)));
50+
logger.debug(MessageFormat.format("verifySignatures - sanitized xmlDoc {0}", Encoding.documentToString(this.xmlDoc)));
5251
return true;
5352
}
5453
}
@@ -74,7 +73,7 @@ public String getRoles(String name) {
7473
}
7574

7675
public boolean isLogout(){
77-
return SamlAssertionUtils.isLogout(this.verifiedDoc);
76+
return SamlAssertionUtils.isLogout(this.xmlDoc);
7877
}
7978

8079
// EXTERNAL OBJECT PUBLIC METHODS - END

gamsaml20/src/main/java/com/genexus/saml20/utils/SamlAssertionUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static Document loadDocument(String xml) {
5151

5252
public static String buildXmlLogin(List<org.w3c.dom.Element> assertions, Document xmlDoc){
5353
//security meassure against assertion manipulation, it assures that every assertion to be used on the app has been signed and verified
54+
logger.trace("buildXmlLogin");
5455
org.w3c.dom.Element element = xmlDoc.getDocumentElement();
5556
Node response = element.cloneNode(false);
5657

@@ -67,8 +68,10 @@ public static String buildXmlLogin(List<org.w3c.dom.Element> assertions, Documen
6768
}
6869

6970
public static String buildXmlLogout(List<org.w3c.dom.Element> assertions){
71+
logger.trace("buildXmlLogout");
7072
if(assertions.isEmpty())
7173
{
74+
logger.error("buildXmlLogout - There are 0 signed assertions on LogoutResponse");
7275
return "";
7376
}
7477
org.w3c.dom.Element element = assertions.get(0);

0 commit comments

Comments
 (0)