summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2014-12-10 10:49:45 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2016-02-17 16:42:42 +0200
commitcb8048312e0d3ee2b49fbef601b6268e6dbf6ab0 (patch)
tree0c1678dbe40044ee0ccf1a845846f827a752d080
parentebc12cddcab02488c28ba234aeadc0cb4afa7d45 (diff)
downloadvaadin-framework-7.6.3.tar.gz
vaadin-framework-7.6.3.zip
Prevent HTTP Response splitting in case the server doesn't (#19611)7.6.3
Prevent user-provided input used in the redirect from containing newline characters as the user agent would interpret subsequent parts of the input as additional headers or the actual HTTP payload. At least modern versions of Tomcat and Jetty already protect against this kind of attack by escaping received header values, but that is not necessarily the case for older versions or other servlet engines. See https://www.owasp.org/index.php/HTTP_Response_Splitting for details. Change-Id: I7a56fe2faeaa738aff964cf754e3f7b0f66181dc
-rw-r--r--server/src/com/vaadin/server/VaadinServlet.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java
index e7799dac67..cd6e4cd7cd 100644
--- a/server/src/com/vaadin/server/VaadinServlet.java
+++ b/server/src/com/vaadin/server/VaadinServlet.java
@@ -403,6 +403,8 @@ public class VaadinServlet extends HttpServlet implements Constants {
location = location + "/" + lastPathParameter;
String queryString = request.getQueryString();
if (queryString != null) {
+ // Prevent HTTP Response splitting in case the server doesn't
+ queryString = queryString.replaceAll("[\\r\\n]", "");
location += '?' + queryString;
}
response.sendRedirect(location);