home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / cert0092.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  9.1 KB  |  228 lines

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT(sm) Advisory CA-95:04
  6. Original issue date:  February 17, 1995
  7. Last revised: August 7, 1996
  8.               Information previously in the README was inserted
  9.               into the advisory.
  10.  
  11.               A complete revision history is at the end of this file.        
  12.  
  13. Topic: NCSA HTTP Daemon for UNIX Vulnerability
  14. - -----------------------------------------------------------------------------
  15.  
  16. The CERT Coordination Center has received reports that there is a
  17. vulnerability in the NCSA HTTP Daemon V.1.3 for UNIX. Because of this
  18. vulnerability, the daemon can be tricked into executing shell commands.
  19.  
  20. If you have any questions regarding this vulnerability, please contact NCSA
  21. (Elizabeth Frank, efrank@ncsa.uiuc.edu).
  22.  
  23. We will update this advisory as we receive additional information.
  24. Please check advisory files regularly for updates that relate to your site.
  25.  
  26. - -----------------------------------------------------------------------------
  27.  
  28. I.   Description
  29.  
  30.      A vulnerability in the NCSA HTTP Daemon allows it to be tricked into
  31.      executing shell commands.
  32.  
  33. II.  Impact
  34.  
  35.      Remote users may gain unauthorized access to the account (uid) under
  36.      which the httpd process is running.
  37.  
  38. III. Solution
  39.  
  40.      Review the text provided by NSCA (#1 below) and install the patch
  41.      provided under #2 below.
  42.  
  43.      1. Read the following text, which was provided by the HTTPD Team at SDG
  44.         at NCSA. This text replaces Step 1 in the original version of the
  45.         advisory. The NCSA text can also be found at  
  46.          
  47.            http://hoohoo.ncsa.uiuc.edu/docs/patch_desc.html
  48.  
  49.                    Beginning of Text Provided by NCSA
  50. ==============================================================================
  51.  
  52.                   NCSA httpd Patch for Buffer Overflow
  53.  
  54. A vulnerability was recently discovered in the NCSA httpd. A program which will
  55. break into an HP system running the precompiled httpd has been published, along
  56. with step by step instructions. The program overflows a buffer into program
  57. space which then gets executed.
  58.  
  59. If you are running a precompiled NCSA httpd, please ftp a new copy of the
  60. binary. If you have compiled your own source code, we recommend applying the
  61. following Patch to fix the vulnerability in the NCSA HTTP Daemon V.1.3 for
  62. UNIX. It modifies the strsubfirst subroutine in util.c.
  63.  
  64. We believe that earlier versions of the server are vulnerable to a similar
  65. attack, and strsubfirst should be modified for all releases of the server.
  66.  
  67. [The original version of] Cert Advisory CA-95:04 describes the problem and
  68. includes two suggested steps. We do not recommend taking step 1, which
  69. increases MAX_STRING_LEN to 8192.  There are 154 occurrences of variables using
  70. MAX_STRING_LEN and changing them from 256 to 8192 bytes is going to expand the
  71. memory needed to run httpd tremendously! On top of that, httpd forks a new
  72. process (a complete copy of the parent) for each connection, which if your
  73. site gets hit a lot will use unnecessarily large amounts of memory. We have
  74. already had reports from admins who have made the change saying they are
  75. experiencing performance degradation due to swapping. Step 2, applying the
  76. patch to util.c, should be sufficient to fix the problem. There is
  77. significantly less forking in Release 1.4 of the NCSA HTTP Daemon which will
  78. be released soon.
  79.  
  80. Detecting a Break-in
  81.  
  82. If the access log contains control characters, there is a chance that someone
  83. has tried to break into your system. If your server has died recently, they
  84. failed at least one attempt. And, if your server has not crashed and there are
  85. control characters in the access log you should assume your system has been
  86. compromised.
  87.  
  88. In this case, servers which currently use the User Directive to run the server
  89. as "nobody", have limited the potential damage of an intruder to those commands
  90. which "nobody" may execute.
  91.  
  92. Control Characters in the Access Log
  93.  
  94. You've discovered control characters in your access log. How do you tell if was
  95. an intruder?
  96.  
  97. If the beginning of the line containing the control characters begins sensibly
  98. (eg. machine name, and date (the GET periodically gets clobbered)) and ends
  99. with a series of control characters, it is a break-in attempt. If the beginning
  100. of the line starts with control characters (often nulls), this is a symptom of
  101. a collision problem that occurs when two children try to write to the access
  102. log simultaneously. This problem has only been seen with moderately to heavily
  103. loaded servers. (We are working to fix this in Release 1.4.)
  104.  
  105. Other ways to Make Your Server More Secure
  106.  
  107. A tutorial about running a secure server is available. We also recommend that
  108. the User Directive be used to run the server as "nobody".
  109.  
  110. Patched Source and Binaries
  111.  
  112. The patched source and precompiled binaries are available. We will also be
  113. correcting the source for previous releases, but we will NOT be generating
  114. binaries for previous releases.
  115.  
  116. Elizabeth Frank
  117. efrank@ncsa.uiuc.edu
  118.  
  119. ==============================================================================
  120.                         End of Text Provided by NCSA
  121.  
  122.      2. Install the following patch, which performs the functionality of
  123.         strsubfirst (i.e., copy src followed by dest[start] into dest) without
  124.         the use of a temporary buffer.  
  125.         
  126. - ----------------------------------cut here-------------------------------------
  127.  
  128. *** util.c.bak  Sat May  7 21:47:15 1994
  129. - --- util.c      Thu Feb 16 04:17:07 1995
  130. ***************
  131. *** 158,168 ****
  132.    
  133.   void strsubfirst(int start,char *dest, char *src)
  134.   {
  135. !     char tmp[MAX_STRING_LEN];
  136.   
  137. !     strcpy(tmp,&dest[start]);
  138. !     strcpy(dest,src);
  139. !     strcpy(&dest[strlen(src)],tmp);
  140.   }
  141.   
  142.   /*
  143. - --- 158,174 ----
  144.   
  145.   void strsubfirst(int start,char *dest, char *src)
  146.   {
  147. !   int src_len, dest_len, i;
  148.   
  149. !   if ((src_len=strlen(src))<start){  /** src "fits" in dest **/
  150. !     for (i=0;dest[i]=src[i];i++);
  151. !     for (i=src_len;dest[i]=dest[i-src_len+start];i++);
  152. !   }
  153. !   else {                             /** src doesn't fit in dest **/
  154. !     for (dest_len=strlen(dest),i=dest_len+src_len-start;i>=src_len;i--)
  155. !       dest[i] = dest[i-src_len+start];
  156. !     for (i=0;i<src_len;i++) dest[i]=src[i];
  157. !   }
  158.   }
  159.   
  160.   /*
  161.  
  162. - ---------------------------------cut here------------------------------------- 
  163.  
  164. After you apply this patch, recompile httpd, kill the current running process,
  165. and restart the new httpd.
  166.  
  167. - ---------------------------------------------------------------------------
  168. The CERT Coordination Center thanks Steve Weeber, Carlos Varela, and
  169. Beth Frank for their support in responding to this problem.
  170. - ---------------------------------------------------------------------------
  171.  
  172. If you believe that your system has been compromised, contact the CERT
  173. Coordination Center or your representative in Forum of Incident
  174. Response and Security Teams (FIRST).
  175.  
  176. If you wish to send sensitive incident or vulnerability information to
  177. CERT staff by electronic mail, we strongly advise that the e-mail be
  178. encrypted.  The CERT Coordination Center can support a shared DES key, PGP
  179. (public key available via anonymous FTP on info.cert.org), or PEM (contact
  180. CERT staff for details).
  181.  
  182. Internet E-mail: cert@cert.org
  183. Telephone: +1 412-268-7090 (24-hour hotline)
  184.            CERT personnel answer 8:30 a.m.-5:00 p.m. EST(GMT-5)/EDT(GMT-4),
  185.            and are on call for emergencies during other hours.
  186. Fax: +1 412-268-6989
  187.  
  188. Postal address:  CERT Coordination Center
  189.                  Software Engineering Institute
  190.                  Carnegie Mellon University
  191.                  Pittsburgh, PA 15213-3890
  192.                  USA
  193.  
  194. CERT advisories and bulletins are posted on the USENET newsgroup
  195. comp.security.announce. If you would like to have future advisories and
  196. bulletins mailed to you or to a mail exploder at your site, please send mail
  197. to cert-advisory-request@cert.org.
  198.  
  199. Past advisories, CERT bulletins, information about FIRST representatives, and
  200. other information related to computer security are available for anonymous FTP
  201. from info.cert.org. 
  202.  
  203. Copyright 1995, 1996 Carnegie Mellon University
  204. This material may be reproduced and distributed without permission provided
  205. it is used for noncommercial purposes and the copyright statement is
  206. included.
  207.  
  208. CERT is a service mark of Carnegie Mellon University.
  209.  
  210. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  211. Revision history
  212.  
  213. Aug. 07, 1996  Information previously in the README was inserted
  214.                          into the advisory.
  215. Mar. 15, 1995  Sec. III - Replaced original Step 1 with text from NCSA.
  216.                           Updated NCSA contact information.
  217.  
  218. -----BEGIN PGP SIGNATURE-----
  219. Version: 2.6.2
  220.  
  221. iQCVAwUBMiSzrHVP+x0t4w7BAQGTAQQAl1wxiez9AmuHczSLa/5OcfiKUPs0zCjm
  222. rp4svG4ioB0GWNcqMtfrCcNhqCKJdxovMJSHCoyvLM5CP454HblmtDyD4CBMyvZW
  223. AFHEbD2WAwcKB/v9YGAYUSpN5bjD6veXt6HKz/dUKjCL+fqIi+u2zFkhNTGfRiIp
  224. aVrewDPIFjY=
  225. =Gxac
  226. -----END PGP SIGNATURE-----
  227.  
  228.