Author: ndkhoiits
Date: 2011-09-14 04:00:31 -0400 (Wed, 14 Sep 2011)
New Revision: 7402
Modified:
portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/TreeNode.java
portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/page/UIWizardPageSetInfo.gtmpl
Log:
GTNPORTAL-2069 XSS vulnerability in Node label input
Modified:
portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/TreeNode.java
===================================================================
---
portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/TreeNode.java 2011-09-14
07:11:15 UTC (rev 7401)
+++
portal/branches/xss/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/TreeNode.java 2011-09-14
08:00:31 UTC (rev 7402)
@@ -7,6 +7,7 @@
import org.exoplatform.portal.mop.user.UserNavigation;
import org.exoplatform.portal.mop.user.UserNode;
import org.exoplatform.portal.webui.util.Util;
+import org.gatein.common.text.EntityEncoder;
import java.util.HashMap;
import java.util.LinkedList;
@@ -224,7 +225,7 @@
return node.getName();
}
- return label;
+ return EntityEncoder.FULL.encode(label);
}
}
}
Modified:
portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/page/UIWizardPageSetInfo.gtmpl
===================================================================
---
portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/page/UIWizardPageSetInfo.gtmpl 2011-09-14
07:11:15 UTC (rev 7401)
+++
portal/branches/xss/web/portal/src/main/webapp/groovy/portal/webui/page/UIWizardPageSetInfo.gtmpl 2011-09-14
08:00:31 UTC (rev 7402)
@@ -1,6 +1,7 @@
<%
import org.exoplatform.portal.webui.navigation.UIPageNodeSelector;
import org.exoplatform.webui.core.UIComponent;
+ import org.gatein.common.text.EntityEncoder;
String nodeName = "/";
boolean isNoSelecter = !uicomponent.getChild(UIPageNodeSelector.class).isRendered();
@@ -10,7 +11,7 @@
<div class="<%=isNoSelecter ? "NoPageSelecter" :
""%>">
<%if(!isNoSelecter) {
def pageNode = uicomponent.getSelectedPageNode();
- if( pageNode!=null && pageNode.getResolvedLabel() != null ) nodeName +=
pageNode.getResolvedLabel();
+ if( pageNode != null && pageNode.getResolvedLabel() != null ) nodeName +=
pageNode.getResolvedLabel();
%>
<div class="PageNodeContainer">
<% uicomponent.renderChild(UIPageNodeSelector.class); %>
@@ -22,11 +23,12 @@
<div class="OverflowContainer">
<div class="Icon"><span></span></div>
<div class="Label"><%=_ctx.appRes(uicomponent.getId() +
".label.curentSelectedNodeInfo")%>:</div>
- <% if(nodeName.length() > 40) { %>
- <div class="Info"><%= nodeName.substring(0,39)
%>...</div>
- <% } else { %>
- <div class="Info"><%= nodeName%></div>
- <% } %>
+ <% if(nodeName.length() > 40) {
+ nodeName = nodeName.substring(0,39) + "...";
+ }
+ nodeName = EntityEncoder.FULL.encode(nodeName);
+ %>
+ <div class="Info">$nodeName</div>
</div>
</div>