From: Jim Jagielski Date: Fri, 24 Oct 2003 16:11:41 +0000 (+0000) Subject: Bump up for 1.3.29. Fold in the CAN-2003-0542 regex patch. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6aa3218f97744d96767fb08c3da0dc9d4472226f;p=thirdparty%2Fapache%2Fhttpd.git Bump up for 1.3.29. Fold in the CAN-2003-0542 regex patch. Get ready to tag. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@101552 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/Announcement b/Announcement index a71c8260346..08a4435f588 100644 --- a/Announcement +++ b/Announcement @@ -4,42 +4,41 @@ The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the release of version 1.3.29 of the Apache HTTP Server ("Apache"). This Announcement notes the significant changes - in 1.3.29 as compared to 1.3.28. + in 1.3.29 as compared to 1.3.28. The Announcement is also available + in German from http://www.apache.org/dist/httpd/Announcement.html.de. - This version of Apache is principally a bug fix release. + This version of Apache is principally a bug and security fix release. A partial summary of the bug fixes is given at the end of this document. - A full listing of changes can be found in the CHANGES file. + A full listing of changes can be found in the CHANGES file. Of + particular note is that 1.3.29 addresses and fixes 1 potential + security issue: + + o CAN-2003-0542 (cve.mitre.org) + Fix buffer overflows in mod_alias and mod_rewrite which occurred if + one configured a regular expression with more than 9 captures. We consider Apache 1.3.29 to be the best version of Apache 1.3 available and we strongly recommend that users of older versions, especially of the 1.1.x and 1.2.x family, upgrade as soon as possible. No further releases will be made in the 1.2.x family. - Apache 1.3.29 is available for download from + Apache 1.3.29 is available for download from: http://httpd.apache.org/download.cgi - - or - - http://www.apache.org/dist/httpd/ - - Please see the CHANGES_1.3 file in the same directory for a full list - of changes. - - Binary distributions are available from - http://www.apache.org/dist/httpd/binaries/ - - The source and binary distributions are also available via any of the - mirrors listed at + This service utilizes the network of mirrors listed at: http://www.apache.org/mirrors/ + Please consult the CHANGES_1.3 file for a full list of changes. + As of Apache 1.3.12 binary distributions contain all standard Apache modules as shared objects (if supported by the platform) and include full source code. Installation is easily done by executing the included install script. See the README.bindist and INSTALL.bindist files for a complete explanation. Please note that the binary distributions are only provided for your convenience and current - distributions for specific platforms are not always available. Win32 + distributions for specific platforms are not always available. Win32 binary distributions are based on the Microsoft Installer (.MSI) technology. While development continues to make this installation method more robust, questions should be directed to the @@ -52,7 +51,7 @@ In general, Apache 1.3 offers several substantial improvements over version 1.2, including better performance, reliability and a wider range of supported platforms, including Windows NT and 2000 (which - fall under the "Win32" label), OS2, Netware, and TPE threaded + fall under the "Win32" label), OS2, Netware, and TPF threaded platforms. Apache is the most popular web server in the known universe; over half @@ -60,7 +59,7 @@ variants. IMPORTANT NOTE FOR APACHE USERS: Apache 1.3 was designed for Unix OS - variants. While the ports to non-Unix platforms (such as Win32, Netware + variants. While the ports to non-Unix platforms (such as Win32, Netware or OS2) are of an acceptable quality, Apache 1.3 is not optimized for these platforms. Security, stability, or performance issues on these non-Unix ports do not generally apply to the Unix version, due to @@ -74,6 +73,11 @@ Apache 1.3.29 Major changes + Security vulnerabilities + + * CAN-2003-0542 (cve.mitre.org) + Fix buffer overflows in mod_alias and mod_rewrite which occurred if + one configured a regular expression with more than 9 captures. New features @@ -90,15 +94,15 @@ and have been fixed in Apache 1.3.29: * Within ap_bclose(), ap_pclosesocket() is now called consistently - for sockets and ap_pclosef() for files. Also, closesocket() - is used consistenly to close socket fd's. The previous + for sockets and ap_pclosef() for files. Also, closesocket() + is used consistenly to close socket fd's. The previous confusion between socket and file fd's would cause problems with some applications now that we proactively close fd's to - prevent leakage. PR 22805 + prevent leakage. PR 22805. * Fixed mod_usertrack to not get false positive matches on the user-tracking cookie's name. PR 16661. * Prevent creation of subprocess Zombies when using CGI wrappers - such as suExec and cgiwrap. PR 21737. [Numerous] + such as suEXEC and cgiwrap. PR 21737. diff --git a/Announcement.de b/Announcement.de index 2fb23ece35a..e87e17606b0 100644 --- a/Announcement.de +++ b/Announcement.de @@ -1,42 +1,39 @@ Apache HTTP Server 1.3.29 freigegeben - Wir, die Apache Software Foundation und das Apache Server Projekt, freuen - uns, die Freigabe der Version 1.3.29 des Apache HTTP Servers ("Apache") - bekannt zu geben. Diese Ankündigung führt die wesentlichen Änderungen von - 1.3.29 gegenüber 1.3.28 auf. Die Ankündigung ist auch in englischer Sprache - unter http://www.apache.org/dist/httpd/Announcement.txt verfügbar. - - Diese Version des Apache ist vornehmlich ein Bug-Fix-Update. - Eine kurze Zusammenfassung der Bug-Fixes ist am Ende des Dokumentes + Wir, die Apache Software Foundation und das Apache HTTP Server Projekt, + freuen uns, die Freigabe der Version 1.3.29 des Apache HTTP Servers + ("Apache") bekannt zu geben. Diese Ankündigung führt die wesentlichen + Änderungen von 1.3.29 gegenüber 1.3.28 auf. Die Ankündigung ist auch in + englischer Sprache unter http://www.apache.org/dist/httpd/Announcement.txt + verfügbar. + + Diese Version des Apache ist vornehmlich ein Bug-Fix- und Sicherheits- + Update. Eine kurze Zusammenfassung der Bug-Fixes ist am Ende des Dokumentes aufgeführt. Die vollständige Liste der Änderungen ist in der CHANGES- - Datei zu finden. + Datei zu finden. Apache 1.3.29 behebt insbesondere 1 Sicherheitslücke. + + o CAN-2003-0542 (cve.mitre.org) + Behebung von Pufferüberläufen in mod_alias und mod_rewrite, welche + auftraten, falls reguläre Ausdrücke mit mehr als 9 speichernden + Klammernpaaren angewendet wurden. Wir betrachten den Apache 1.3.29 als die beste verfügbare Version des Apache 1.3 und wir empfehlen Benutzern älterer Versionen, insbesondere der Familien 1.1.x und 1.2.x, umgehend die Aufrüstung. Für die 1.2.x- Familie werden keine weiteren Releases mehr erstellt. - Apache 1.3.29 steht unter + Apache 1.3.29 steht unter folgender Adresse zum Download bereit: http://httpd.apache.org/download.cgi - - oder - - http://www.apache.org/dist/httpd/ - - zum Download bereit. - - Für eine vollständige Liste der Änderungen lesen Sie bitte die Datei - CHANGES_1.3 im gleichen Verzeichnis. - - Binärdistributionen sind verfügbar unter - http://www.apache.org/dist/httpd/binaries/ - - Die Quelltexte und Binärdistributionen sind ebenso über jeden unter + Dieser Service nutzt das Mirror-Netzwerk, welches unter folgender + Adresse aufgeführt wird: http://www.apache.org/mirrors/ - aufgeführten Mirror erhältlich. + Eine vollständige Auflistung aller bisherigen Änderungen finden Sie in + der Datei CHANGES_1.3. Seit Apache 1.3.12 enthalten Binärdistributionen alle Apache-Standard- module als Shared Objects (sofern es von der Plattform unterstützt @@ -74,39 +71,45 @@ Allgemeinen nicht die Unix-Version. Der Apache 2.0 wurde durch die Einführung der Apache Portability Library - und MPM-Module von Anfang an für mehrere Betriebssysteme konstruiert. + und der MPM-Module von Anfang an für mehrere Betriebssysteme konstruiert. Nutzer von nicht-Unix-Plattformen sind dringend angehalten, aufgrund der besseren Performance, Stabilität und Sicherheit auf den Apache 2.0 zu wechseln. Wesentliche Änderungen des Apache 1.3.29 + Sicherheitslücken + + o CAN-2003-0542 (cve.mitre.org) + Behebung von Pufferüberläufen in mod_alias und mod_rewrite, welche + auftraten, falls reguläre Ausdrücke mit mehr als 9 speichernden + Klammernpaaren angewendet wurden. + Neue Features - Neue Features, die sich auf bestimmte Plattformen beziehen: + Neue Features, die sich auf bestimmte Plattformen beziehen: - * Die ident-Funktionalität gemäß RFC1413 ist nun sowohl für - Windows- wie auch für NetWare-Plattformen verfügbar. Dies - beinhaltet auch eine alternative Thread-sichere Implementation der - Socket-Timeout-Funktionalität bei der Abfrage des identd-Daemons. + * Die ident-Funktionalität gemäß RFC1413 ist nun sowohl für + Windows- wie auch für NetWare-Plattformen verfügbar. Dies + beinhaltet auch eine alternative Thread-sichere Implementation der + Socket-Timeout-Funktionalität bei der Abfrage des identd-Daemons. Behobene Fehler - Die folgenden nennenswerten Fehler wurden im Apache 1.3.28 (oder - früher) gefunden und im Apache 1.3.29 behoben: + Die folgenden nennenswerten Fehler wurden im Apache 1.3.28 (oder + früher) gefunden und im Apache 1.3.29 behoben: - * Innerhalb von ap_bclose() wird nun durchweg ap_pclosesocket() für - Sockets und sp_pclosef() für Dateien aufgerufen. Ebenso wird nun - einheitlich closesocket() zum Schließen der (Dateideskriptoren von) - Sockets verwendet. Das vorherige Durcheinander von Dateideskriptoren - für Sockets und Dateien würde bei einigen Applikationen Probleme - verursachen, jetzt wo wir vorsorglich Dateideskriptoren schließen, - um Lecks zu vermeiden. PR 22805 - - * Korrektur von mod_usertrack, um keine fälschlich zutreffenden - Übereinstimmungen mit dem Namen des user-tracking-Cookies zu - erhalten. PR 16661. + * Innerhalb von ap_bclose() wird nun durchweg ap_pclosesocket() für + Sockets und sp_pclosef() für Dateien aufgerufen. Ebenso wird nun + einheitlich closesocket() zum Schließen der (Dateideskriptoren von) + Sockets verwendet. Das vorherige Durcheinander von Dateideskriptoren + für Sockets und Dateien würde bei einigen Applikationen Probleme + verursachen, jetzt wo wir vorsorglich Dateideskriptoren schließen, + um Lecks zu vermeiden. PR 22805. - * Die Bildung von Subprozess-Zombies bei der Verwendung von CGI-Wrappern - wie suExec und cgiwrap wird verhindert. PR 21737. [Numerous] + * Korrektur von mod_usertrack, um keine fälschlich zutreffenden + Übereinstimmungen mit dem Namen des user-tracking-Cookies zu + erhalten. PR 16661. + * Die Bildung von Subprozess-Zombies bei der Verwendung von CGI-Wrappern + wie suEXEC und cgiwrap wird verhindert. PR 21737. diff --git a/STATUS b/STATUS index 7e936d193ba..a0919238896 100644 --- a/STATUS +++ b/STATUS @@ -1,9 +1,9 @@ APACHE 1.3 STATUS: -*-text-*- - Last modified at [$Date: 2003/10/20 19:52:50 $] + Last modified at [$Date: 2003/10/24 16:11:40 $] Release: - 1.3.29-dev: In development. Jim proposes a release RSN. + 1.3.29: Tagged October 24, 2003. 1.3.28: Tagged July 16, 2003. 1.3.27: Tagged September 30, 2002. Announced Oct 3, 2002. 1.3.26: Tagged June 18, 2002. diff --git a/src/CHANGES b/src/CHANGES index bb033c41037..f7e44fb99e7 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 1.3.29 + *) SECURITY: CAN-2003-0542 (cve.mitre.org) + Fix buffer overflows in mod_alias and mod_rewrite which occurred if + one configured a regular expression with more than 9 captures. + [André Malo] + *) Within ap_bclose(), ap_pclosesocket() is now called consistently for sockets and ap_pclosef() for files. Also, closesocket() is used consistenly to close socket fd's. The previous diff --git a/src/include/httpd.h b/src/include/httpd.h index fe5c2b36df8..289dba27f7d 100644 --- a/src/include/httpd.h +++ b/src/include/httpd.h @@ -274,6 +274,9 @@ extern "C" { /* The size of the server's internal read-write buffers */ #define IOBUFSIZE 8192 +/* The max number of regex captures that can be expanded by ap_pregsub */ +#define AP_MAX_REG_MATCH 10 + /* Number of servers to spawn off by default --- also, if fewer than * this free when the caretaker checks, it will spawn more. */ @@ -428,7 +431,7 @@ extern "C" { #define SERVER_BASEVENDOR "Apache Group" #define SERVER_BASEPRODUCT "Apache" -#define SERVER_BASEREVISION "1.3.29-dev" +#define SERVER_BASEREVISION "1.3.29" #define SERVER_BASEVERSION SERVER_BASEPRODUCT "/" SERVER_BASEREVISION #define SERVER_PRODUCT SERVER_BASEPRODUCT @@ -449,7 +452,7 @@ API_EXPORT(const char *) ap_get_server_built(void); * Always increases along the same track as the source branch. * For example, Apache 1.4.2 would be '10402100', 2.5b7 would be '20500007'. */ -#define APACHE_RELEASE 10329000 +#define APACHE_RELEASE 10329100 #define SERVER_PROTOCOL "HTTP/1.1" #ifndef SERVER_SUPPORT diff --git a/src/modules/standard/mod_alias.c b/src/modules/standard/mod_alias.c index 78e7b17fb3e..05ef6a8df54 100644 --- a/src/modules/standard/mod_alias.c +++ b/src/modules/standard/mod_alias.c @@ -299,7 +299,7 @@ static int alias_matches(const char *uri, const char *alias_fakename) static char *try_alias_list(request_rec *r, array_header *aliases, int doesc, int *status) { alias_entry *entries = (alias_entry *) aliases->elts; - regmatch_t regm[10]; + regmatch_t regm[AP_MAX_REG_MATCH]; char *found = NULL; int i; @@ -308,10 +308,10 @@ static char *try_alias_list(request_rec *r, array_header *aliases, int doesc, in int l; if (p->regexp) { - if (!ap_regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) { + if (!ap_regexec(p->regexp, r->uri, AP_MAX_REG_MATCH, regm, 0)) { if (p->real) { found = ap_pregsub(r->pool, p->real, r->uri, - p->regexp->re_nsub + 1, regm); + AP_MAX_REG_MATCH, regm); if (found && doesc) { found = ap_escape_uri(r->pool, found); } diff --git a/src/modules/standard/mod_rewrite.c b/src/modules/standard/mod_rewrite.c index 9726d46852e..25a2fb3126f 100644 --- a/src/modules/standard/mod_rewrite.c +++ b/src/modules/standard/mod_rewrite.c @@ -1834,7 +1834,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, const char *vary; char newuri[MAX_STRING_LEN]; regex_t *regexp; - regmatch_t regmatch[MAX_NMATCH]; + regmatch_t regmatch[AP_MAX_REG_MATCH]; backrefinfo *briRR = NULL; backrefinfo *briRC = NULL; int prefixstrip; @@ -1891,7 +1891,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, rewritelog(r, 3, "[per-dir %s] applying pattern '%s' to uri '%s'", perdir, p->pattern, uri); } - rc = (ap_regexec(regexp, uri, regexp->re_nsub+1, regmatch, 0) == 0); + rc = (ap_regexec(regexp, uri, AP_MAX_REG_MATCH, regmatch, 0) == 0); if (! (( rc && !(p->flags & RULEFLAG_NOTMATCH)) || (!rc && (p->flags & RULEFLAG_NOTMATCH)) ) ) { return 0; @@ -2179,7 +2179,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char input[MAX_STRING_LEN]; struct stat sb; request_rec *rsub; - regmatch_t regmatch[MAX_NMATCH]; + regmatch_t regmatch[AP_MAX_REG_MATCH]; int rc; /* @@ -2283,8 +2283,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, } else { /* it is really a regexp pattern, so apply it */ - rc = (ap_regexec(p->regexp, input, - p->regexp->re_nsub+1, regmatch,0) == 0); + rc = (ap_regexec(p->regexp, input, AP_MAX_REG_MATCH, regmatch,0) == 0); /* if it isn't a negated pattern and really matched we update the passed-through regex subst info structure */ @@ -2442,7 +2441,7 @@ static void do_expand(request_rec *r, char *input, char *buffer, int nbuf, bri = briRC; } /* see ap_pregsub() in src/main/util.c */ - if (bri && n <= bri->nsub && + if (bri && n < AP_MAX_REG_MATCH && bri->regmatch[n].rm_eo > bri->regmatch[n].rm_so) { span = bri->regmatch[n].rm_eo - bri->regmatch[n].rm_so; if (span > space) { diff --git a/src/modules/standard/mod_rewrite.h b/src/modules/standard/mod_rewrite.h index 93729677a37..8f2fd709b85 100644 --- a/src/modules/standard/mod_rewrite.h +++ b/src/modules/standard/mod_rewrite.h @@ -253,8 +253,6 @@ #define MAX_ENV_FLAGS 15 -#define MAX_NMATCH 10 - /* default maximum number of internal redirects */ #define REWRITE_REDIRECT_LIMIT 10 @@ -368,7 +366,7 @@ typedef struct cache { typedef struct backrefinfo { char *source; int nsub; - regmatch_t regmatch[10]; + regmatch_t regmatch[AP_MAX_REG_MATCH]; } backrefinfo;