Skip to content

Commit c76fed3

Browse files
authored
ViewStatusMessagesServlet requires method POST for button 'Clear' (#971)
The button 'Clear' has a side-effect and should not work with GET, as GET is considered a Safe Method not taking an action other than retrieval. https://www.rfc-editor.org/rfc/rfc2616#section-9.1.1 I'd like to restrict users from doing any changes by restricting them to method GET. With that said one might consider this change as a security fix. Signed-off-by: Ralf Wiebicke <[email protected]>
1 parent 61f6a25 commit c76fed3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

logback-core/src/main/java/ch/qos/logback/core/status/ViewStatusMessagesServletBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected void service(HttpServletRequest req, HttpServletResponse resp) throws
6262
output.append("<input type=\"submit\" name=\"" + SUBMIT + "\" value=\"" + CLEAR + "\">");
6363
output.append("</form>\r\n");
6464

65-
if (CLEAR.equalsIgnoreCase(req.getParameter(SUBMIT))) {
65+
if ("POST".equals(req.getMethod()) && CLEAR.equalsIgnoreCase(req.getParameter(SUBMIT))) {
6666
sm.clear();
6767
sm.add(new InfoStatus("Cleared all status messages", this));
6868
}

0 commit comments

Comments
 (0)