Blame SOURCES/tomcat-7.0.76-CVE-2018-11784.patch

a482a9
diff -up java/org/apache/catalina/servlets/DefaultServlet.java.orig java/org/apache/catalina/servlets/DefaultServlet.java
a482a9
--- java/org/apache/catalina/servlets/DefaultServlet.java.orig	2019-02-12 09:16:19.144563964 -0500
a482a9
+++ java/org/apache/catalina/servlets/DefaultServlet.java	2019-02-12 09:16:52.516485998 -0500
a482a9
@@ -1103,6 +1103,10 @@ public class DefaultServlet
a482a9
             location.append('?');
a482a9
             location.append(request.getQueryString());
a482a9
         }
a482a9
+        // Avoid protocol relative redirects
a482a9
+        while (location.length() > 1 && location.charAt(1) == '/') {
a482a9
+            location.deleteCharAt(0);
a482a9
+        }
a482a9
         response.sendRedirect(response.encodeRedirectURL(location.toString()));
a482a9
     }
a482a9
a482a9
diff -up webapps/docs/changelog.xml.orig webapps/docs/changelog.xml
a482a9
--- webapps/docs/changelog.xml.orig	2019-02-12 09:18:01.155325629 -0500
a482a9
+++ webapps/docs/changelog.xml	2019-02-12 09:18:36.354243382 -0500
a482a9
@@ -57,6 +57,16 @@
a482a9
   They eventually become mixed with the numbered issues. (I.e., numbered
a482a9
   issues do not "pop up" wrt. others).
a482a9
 -->
a482a9
+<section name="Tomcat 7.0.76-9 (csutherl)">
a482a9
+  <subsection name="Catalina">
a482a9
+    <changelog>
a482a9
+      <fix>
a482a9
+        When generating a redirect to a directory in the Default Servlet, avoid
a482a9
+        generating a protocol relative redirect. (markt)
a482a9
+      </fix>
a482a9
+    </changelog>
a482a9
+  </subsection>
a482a9
+</section>
a482a9
 <section name="Tomcat 7.0.76-8 (csutherl)">
a482a9
   <subsection name="Catalina">
a482a9
     <changelog>