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

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT(sm) Advisory CA-96.11
  6. Original issue date: May 29, 1996
  7. Last revised: August 30, 1996
  8.               Removed references to the advisory README file.
  9.  
  10.               A complete revision history is at the end of this file.
  11.  
  12. Topic: Interpreters in CGI bin Directories
  13. - -----------------------------------------------------------------------------
  14.  
  15. Many sites that maintain a Web server support CGI programs. Often these
  16. programs are scripts that are run by general-purpose interpreters, such as
  17. /bin/sh or PERL. If the interpreters are located in the CGI bin directory
  18. along with the associated scripts, intruders can access the interpreters
  19. directly and arrange to execute arbitrary commands on the Web server system.
  20. This problem has been widely discussed in several forums. Unfortunately, some
  21. sites have not corrected it.
  22.  
  23. The CERT Coordination Center recommends that you never put interpreters in a
  24. Web server's CGI bin directory.
  25.  
  26. We will update this advisory as we receive additional information.
  27. Please check advisory files regularly for updates that relate to your site.
  28.  
  29. - -----------------------------------------------------------------------------
  30. I.   Description
  31.  
  32.      To execute CGI scripts, a Web server must be able to access the
  33.      interpreter used for that script. Early documentation for Netscape and
  34.      other servers recommended placing the interpreters in the CGI bin
  35.      directory to ensure that they were available to run the script.
  36.  
  37.      All programs in the CGI bin directory can be executed with arbitrary
  38.      arguments, so it is important to carefully design the programs
  39.      to permit only the intended actions regardless of what arguments are
  40.      used. This is difficult enough in general, but is a special problem for
  41.      general-purpose interpreters since they are designed to execute
  42.      arbitrary programs based on their arguments. *All* programs in the
  43.      CGI bin directory must be evaluated carefully, even relatively
  44.      limited programs such as gnu-tar and find.
  45.  
  46.      Note that the directory for CGI programs is typically called "cgi-bin"
  47.      but the server may be configured to use a different name.
  48.  
  49. II.  Impact
  50.  
  51.      If general-purpose interpreters are accessible in a Web server's CGI bin
  52.      directory, then a remote user can execute any command the interpreters
  53.      can execute on that server.
  54.  
  55. III. Solution
  56.  
  57.      The solution to this problem is to ensure that the CGI bin directory
  58.      does not include any general-purpose interpreters, for example
  59.              + PERL
  60.              + Tcl
  61.              + UNIX shells (sh, csh, ksh, etc.)
  62.  
  63.      A variety of methods can be used to safely install such interpreters;
  64.      methods vary depending on the system and Web server involved.
  65.  
  66.      On Unix systems, the location of the interpreter is given on the first
  67.      line of the script:
  68.         #! /path/to/interpreter
  69.  
  70.      On other systems, such as NT, there is an association between filename
  71.      extensions and the applications used to run them. If your Web server
  72.      uses this association, you can give CGI scripts an appropriate suffix
  73.      (for example, ".pl" for PERL), which is registered to the appropriate
  74.      interpreter. This avoids the need to install the interpreter in the
  75.      CGI bin directory, thus avoiding the problem.
  76.  
  77.      Check with your Web server vendor for specific information.
  78.  
  79.      Netscape reports that the 2.0 versions of their FastTrack and Enterprise
  80.      Servers, (both the current Beta and upcoming final versions), do support
  81.      file interpreter associations.
  82.  
  83.      Further reading:
  84.  
  85.         Tom Christiansen has a Web page with details about this problem
  86.         and a script that can be used to test for it:
  87.                 http://perl.com/perl/news/latro-announce.html
  88.  
  89.          Lincoln Stein's WWW Security FAQ includes a section on "Problems
  90.          with Specific Servers," which discusses this and related problems:
  91.                 http://www.genome.wi.mit.edu/WWW/faqs/www-security-faq.html
  92.  
  93. - ---------------------------------------------------------------------------
  94. The CERT Coordination Center thanks Lincoln Stein, Tom Christiansen, and the
  95. members of AUSCERT and DFN-CERT for their contributions to the information in
  96. this advisory.
  97. - ---------------------------------------------------------------------------
  98.  
  99. If you believe that your system has been compromised, contact the CERT
  100. Coordination Center or your representative in the Forum of Incident
  101. Response and Security Teams (FIRST).
  102.  
  103. We strongly urge you to encrypt any sensitive information you send by email.
  104. The CERT Coordination Center can support a shared DES key and PGP. Contact
  105. the CERT staff for more information.
  106.  
  107. Location of CERT PGP key
  108.          ftp://info.cert.org/pub/CERT_PGP.key
  109.  
  110. CERT Contact Information
  111. - ------------------------
  112. Email    cert@cert.org
  113.  
  114. Phone    +1 412-268-7090 (24-hour hotline)
  115.                 CERT personnel answer 8:30-5:00 p.m. EST
  116.                 (GMT-5)/EDT(GMT-4), and are on call for
  117.                 emergencies during other hours.
  118.  
  119. Fax      +1 412-268-6989
  120.  
  121. Postal address
  122.         CERT Coordination Center
  123.         Software Engineering Institute
  124.         Carnegie Mellon University
  125.         Pittsburgh PA 15213-3890
  126.         USA
  127.  
  128. CERT publications, information about FIRST representatives, and other
  129. security-related information are available for anonymous FTP from
  130.         http://www.cert.org/
  131.         ftp://info.cert.org/pub/
  132.  
  133. CERT advisories and bulletins are also posted on the USENET newsgroup
  134.         comp.security.announce
  135.  
  136. To be added to our mailing list for CERT advisories and bulletins, send your
  137. email address to
  138.         cert-advisory-request@cert.org
  139.  
  140.  
  141. Copyright 1996 Carnegie Mellon University
  142. This material may be reproduced and distributed without permission provided
  143. it is used for noncommercial purposes and the copyright statement is
  144. included.
  145.  
  146. CERT is a service mark of Carnegie Mellon University.
  147.  
  148.  
  149. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  150. Revision history
  151.  
  152. Aug. 30, 1996  Removed references to CA-96.11.README.
  153.  
  154.  
  155.  
  156.  
  157.  
  158. -----BEGIN PGP SIGNATURE-----
  159. Version: 2.6.2
  160.  
  161. iQCVAwUBMiTEznVP+x0t4w7BAQGUSgQAkyk5kZXkVOecd1wH75prQsBJVTiduRdF
  162. d60VgCwjaR79/PwmxBBijC8oB42xuPrBNyuCfQm00l4+US7hV25b91J3aQO3obmr
  163. eRL+dZnU9cGzk9sD3V49W7wweWroANYVN60jF2uPEq4uHsnggyjGZDVS1RCo/9iL
  164. 5R1UX3M965Y=
  165. =FgjX
  166. -----END PGP SIGNATURE-----
  167.  
  168.