Skip to content

Commit

Permalink
Fix XSS issue in Manager and Host Manager. This is CVE-2007-2450.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@547077 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jun 14, 2007
1 parent 85d386f commit 1bc3bcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 6 additions & 3 deletions java/org/apache/catalina/manager/HTMLManagerServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ public void doGet(HttpServletRequest request,
message = stop(path);
} else {
message =
sm.getString("managerServlet.unknownCommand",
RequestUtil.filter(command));
sm.getString("managerServlet.unknownCommand", command);
}

list(request, response, message);
Expand Down Expand Up @@ -305,7 +304,11 @@ public void list(HttpServletRequest request,
// Message Section
args = new Object[3];
args[0] = sm.getString("htmlManagerServlet.messageLabel");
args[1] = (message == null || message.length() == 0) ? "OK" : message;
if (message == null || message.length() == 0) {
args[1] = "OK";
} else {
args[1] = RequestUtil.filter(message);
}
writer.print(MessageFormat.format(Constants.MESSAGE_SECTION, args));

// Manager Section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import org.apache.catalina.Container;
import org.apache.catalina.Host;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.ServerInfo;

/**
Expand Down Expand Up @@ -195,7 +196,11 @@ public void list(HttpServletRequest request,
// Message Section
args = new Object[3];
args[0] = sm.getString("htmlHostManagerServlet.messageLabel");
args[1] = (message == null || message.length() == 0) ? "OK" : message;
if (message == null || message.length() == 0) {
args[1] = "OK";
} else {
args[1] = RequestUtil.filter(message);
}
writer.print(MessageFormat.format(Constants.MESSAGE_SECTION, args));

// Manager Section
Expand Down

0 comments on commit 1bc3bcb

Please sign in to comment.