浏览代码

Prevent HTTP Response splitting in case the server doesn't (#19611)

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: If4b9bf5fba953073de49c1ab1cba8e5e6bc8e546
tags/7.7.0.alpha1
Leif Åstrand 9 年前
父节点
当前提交
29808ef927
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      server/src/com/vaadin/server/VaadinServlet.java

+ 2
- 0
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);

正在加载...
取消
保存