Commit de1ababc authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed cross-site scripting vulnerability. JM-545

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3361 b35dd754-fafc-0310-a699-88a17e54d16e
parent cdd89c2a
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<p> <p>
<fmt:message key="session.details.info"> <fmt:message key="session.details.info">
<fmt:param value="<%= "<b>"+address.toString()+"</b>" %>" /> <fmt:param value="<%= "<b>"+URLEncoder.encode(address.toString(), "UTF-8")+"</b>" %>" />
<fmt:param value="<%= address.getNode() == null ? "" : "<b>"+address.getNode()+"</b>" %>" /> <fmt:param value="<%= address.getNode() == null ? "" : "<b>"+address.getNode()+"</b>" %>" />
</fmt:message> </fmt:message>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<fmt:message key="session.details.session_id" /> <fmt:message key="session.details.session_id" />
</td> </td>
<td> <td>
<%= address.toString() %> <%= URLEncoder.encode(address.toString(), "UTF-8") %>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -108,12 +108,12 @@ ...@@ -108,12 +108,12 @@
<% String n = address.getNode(); %> <% String n = address.getNode(); %>
<% if (n == null || "".equals(n)) { %> <% if (n == null || "".equals(n)) { %>
<i> <fmt:message key="session.details.anonymous" /> </i> - <%= address.getResource()==null?"":address.getResource() %> <i> <fmt:message key="session.details.anonymous" /> </i> - <%= address.getResource()==null?"":URLEncoder.encode(address.getResource(), "UTF-8") %>
<% } else { %> <% } else { %>
<a href="user-properties.jsp?username=<%= n %>"><%= n %></a> <a href="user-properties.jsp?username=<%= n %>"><%= n %></a>
- <%= address.getResource()==null?"":address.getResource() %> - <%= address.getResource()==null?"":URLEncoder.encode(address.getResource(), "UTF-8") %>
<% } %> <% } %>
</td> </td>
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
Presence.Show show = currentSess.getPresence().getShow(); Presence.Show show = currentSess.getPresence().getShow();
String statusTxt = currentSess.getPresence().getStatus(); String statusTxt = currentSess.getPresence().getStatus();
if (statusTxt != null) { if (statusTxt != null) {
statusTxt = " -- " + statusTxt; statusTxt = " -- " + URLEncoder.encode(statusTxt, "UTF-8");
} }
else { else {
statusTxt = ""; statusTxt = "";
...@@ -312,7 +312,7 @@ ...@@ -312,7 +312,7 @@
<br> <br>
<form action="session-details.jsp"> <form action="session-details.jsp">
<input type="hidden" name="jid" value="<%= jid %>"> <input type="hidden" name="jid" value="<%= URLEncoder.encode(jid, "UTF-8") %>">
<center> <center>
<%--<% if (!isAnonymous && presenceManager.isAvailable(user)) { %>--%> <%--<% if (!isAnonymous && presenceManager.isAvailable(user)) { %>--%>
<%----%> <%----%>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
><%= ((name != null && !"".equals(name)) ? name : "<i>"+LocaleUtils.getLocalizedString("session.details.anonymous")+"</i>") %></a> ><%= ((name != null && !"".equals(name)) ? name : "<i>"+LocaleUtils.getLocalizedString("session.details.anonymous")+"</i>") %></a>
</td> </td>
<td width="15%" nowrap> <td width="15%" nowrap>
<%= sess.getAddress().getResource() %> <%= URLEncoder.encode(sess.getAddress().getResource(), "UTF-8") %>
</td> </td>
<td> <td>
<% int _status = sess.getStatus(); <% int _status = sess.getStatus();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment