]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1198940 from trunk:
authorJim Jagielski <jim@apache.org>
Sun, 30 Sep 2012 15:42:25 +0000 (15:42 +0000)
committerJim Jagielski <jim@apache.org>
Sun, 30 Sep 2012 15:42:25 +0000 (15:42 +0000)
Fix integer overflow in ap_pregsub. This can be triggered e.g.
with mod_setenvif via a malicious .htaccess

CVE-2011-3607
http://www.halfdog.net/Security/2011/ApacheModSetEnvIfIntegerOverflow/

Submitted by: sf
Reviewed/backported by: jim

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

CHANGES
STATUS
server/util.c

diff --git a/CHANGES b/CHANGES
index 16f01d45be388edcdf59662e97b2416cfbf23773..6e7f87ec65d03ac11945956bd33d18fc642ab92f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.0.65
 
+  *) SECURITY: CVE-2011-3607 (cve.mitre.org)
+     core: Fix integer overflow in ap_pregsub. This can be triggered e.g.
+     with mod_setenvif via a malicious .htaccess. [Stefan Fritsch]
+
   *) SECURITY: CVE-2011-3368 (cve.mitre.org)
      Reject requests where the request-URI does not match the HTTP
      specification, preventing unexpected expansion of target URLs in
diff --git a/STATUS b/STATUS
index 1ada640c225a542a41de6767e15f1c1f6f3c7539..b0402d5ba7639e45bd7edd2a50a00a32d32e647a 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -128,13 +128,6 @@ RELEASE SHOWSTOPPERS:
             I checked proxy_http and could not find a code path to fix.
             More eyes welcome.
 
-  *) SECURITY: CVE-2011-3607 (cve.mitre.org)
-     Fix integer overflow in ap_pregsub() which, when the mod_setenvif module
-     is enabled, could allow local users to gain privileges via a .htaccess
-     file. [Stefan Fritsch, Greg Ames]
-     From 2.2.x; http://svn.apache.org/viewvc?view=revision&revision=1227280
-       +1: gregames, wrowe, trawick
-
   *) SECURITY: CVE-2011-4317 (cve.mitre.org)
      Resolve additional cases of URL rewriting with ProxyPassMatch or
      RewriteRule, where particular request-URIs could result in undesired
index a64f3bf973f43c976be028814e1be7eed9a31534..84840f7974e7ce3bf5fe0fdfed41385b094da41d 100644 (file)
@@ -410,6 +410,8 @@ AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input,
             len++;
         }
         else if (no < nmatch && pmatch[no].rm_so < pmatch[no].rm_eo) {
+            if (APR_SIZE_MAX - len <= pmatch[no].rm_eo - pmatch[no].rm_so)
+                return APR_ENOMEM;
             len += pmatch[no].rm_eo - pmatch[no].rm_so;
         }