We do not advise taking "Step 1" as it will have severe repurcussions throughout the internet. There are 154 occurences of variables using MAX_STRING_LEN and changing them from 256 to 8192 bytes is going to expand the memory needed to run httpd _tremendously_! On top of that, httpd forks a new process (a complete copy of the parent) for _each_ connection, which if your site gets hit a lot would be a disaster! We have already had reports from admins who have made above change saying they are literally being "swapped to a crawl". The patch in "Step 2" fixes this security hole. Thank you very much, NCSA SDG Developers ============================================================================= CA-95:04 CERT Advisory February 17, 1995 NCSA HTTP Daemon for UNIX Vulnerability ----------------------------------------------------------------------------- The CERT Coordination Center has received reports that there is a vulnerability in the NCSA HTTP Daemon V.1.3 for UNIX. Because of this vulnerability, the daemon can be tricked into executing shell commands. If you have any questions regarding this vulnerability, please send e-mail to Beth Frank at the NCSA, efrank@ncsa.uiuc.edu. ----------------------------------------------------------------------------- I. Description A vulnerability in the NCSA HTTP Daemon allows it to be tricked into executing shell commands. II. Impact Remote users may gain unauthorized access to the account (uid) under which the httpd process is running. III. Solution The following solution was provided by the HTTPD Team at SDG at NCSA. Step 1: In the file httpd.h, change the string length definitions from: /* The default string lengths */ #define MAX_STRING_LEN 256 #define HUGE_STRING_LEN 8192 to: /* The default string lengths */ #define HUGE_STRING_LEN 8192 #define MAX_STRING_LEN HUGE_STRING_LEN Step 2: Install the following patch, which performs the functionality of strsubfirst (i.e., copy src followed by dest[start] into dest) without the use of a temporary buffer. ----------------------------------cut here------------------------------------- *** util.c.bak Sat May 7 21:47:15 1994 --- util.c Thu Feb 16 04:17:07 1995 *************** *** 158,168 **** void strsubfirst(int start,char *dest, char *src) { ! char tmp[MAX_STRING_LEN]; ! strcpy(tmp,&dest[start]); ! strcpy(dest,src); ! strcpy(&dest[strlen(src)],tmp); } /* --- 158,174 ---- void strsubfirst(int start,char *dest, char *src) { ! int src_len, dest_len, i; ! if ((src_len=strlen(src))=src_len;i--) ! dest[i] = dest[i-src_len+start]; ! for (i=0;i