]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r549159 from trunk:
authorJoe Orton <jorton@apache.org>
Tue, 17 Jul 2007 15:10:05 +0000 (15:10 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 17 Jul 2007 15:10:05 +0000 (15:10 +0000)
Fix CVE-2006-5752:

* modules/generators/mod_status.c (status_handler): Specify charset in
content-type to prevent browsers doing charset "detection", which
allows an XSS attack.  Use logitem-escaping on the request string to
make it charset-neutral.

Reported by: Stefan Esser <sesser hardened-php.net>
Submitted by: jorton
Reviewed by: jorton, fuankg, rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@556941 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/generators/mod_status.c

diff --git a/CHANGES b/CHANGES
index 6a4b87bab563ef9aa8c7c3e5c7ddc67703f01cd3..f75bcd7b2eca0d3d33f5b74d32437504e46e254c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -11,6 +11,11 @@ Changes with Apache 2.2.5
      be forced to kill processes outside its process group. 
      [Joe Orton, Jim Jagielski]
 
+  *) SECURITY: CVE-2006-5752 (cve.mitre.org)
+     mod_status: Fix a possible XSS attack against a site with a public
+     server-status page and ExtendedStatus enabled, for browsers which
+     perform charset "detection".  Reported by Stefan Esser.  [Joe Orton]
+
   *) mod_cache: Do not set Date or Expires when they are missing from
      the original response or are invalid.  [Justin Erenkrantz]
 
index 7fb0f332f7adeff51001c31c698a373768ca6b30..b2a6ea28cc00671fde2132db762c6e3f8b324454 100644 (file)
@@ -270,7 +270,7 @@ static int status_handler(request_rec *r)
     if (r->method_number != M_GET)
         return DECLINED;
 
-    ap_set_content_type(r, "text/html");
+    ap_set_content_type(r, "text/html; charset=ISO-8859-1");
 
     /*
      * Simple table-driven form data set parser that lets you alter the header
@@ -299,7 +299,7 @@ static int status_handler(request_rec *r)
                     no_table_report = 1;
                     break;
                 case STAT_OPT_AUTO:
-                    ap_set_content_type(r, "text/plain");
+                    ap_set_content_type(r, "text/plain; charset=ISO-8859-1");
                     short_report = 1;
                     break;
                 }
@@ -673,7 +673,8 @@ static int status_handler(request_rec *r)
                                ap_escape_html(r->pool,
                                               ws_record->client),
                                ap_escape_html(r->pool,
-                                              ws_record->request),
+                                              ap_escape_logitem(r->pool,
+                                                                ws_record->request)),
                                ap_escape_html(r->pool,
                                               ws_record->vhost));
                 }
@@ -763,7 +764,8 @@ static int status_handler(request_rec *r)
                                    ap_escape_html(r->pool,
                                                   ws_record->vhost),
                                    ap_escape_html(r->pool,
-                                                  ws_record->request));
+                                                  ap_escape_logitem(r->pool, 
+                                                                    ws_record->request)));
                 } /* no_table_report */
             } /* for (j...) */
         } /* for (i...) */