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

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT(sm) Advisory CA-97.07
  6. Original issue date: February 18, 1997
  7. Last revised: February 21, 1997
  8.           Corrected organization names in acknowledgements.
  9.  
  10. Topic: Vulnerability in the httpd nph-test-cgi script
  11. - -----------------------------------------------------------------------------
  12.  
  13. Because of ongoing activity relating to a vulnerability in the nph-test-cgi
  14. script included with some http daemons, the CERT Coordination Center staff is
  15. issuing this recommendation to check your cgi-bin directory. By exploiting
  16. this vulnerability, users of Web clients can read a listing of files they are
  17. not authorized to see.
  18.  
  19. The CERT/CC team recommends removing the script from your system and checking
  20. Appendix A of this advisory for information provided by vendors.
  21.  
  22. We also urge you to read CERT advisory CA-96.06.cgi_example_code for
  23. another CGI-related vulnerability that continues to be exploited.
  24.  
  25. We will update this advisory as we receive additional information.
  26. Please check advisory files regularly for updates that relate to your site.
  27.  
  28. - -----------------------------------------------------------------------------
  29.  
  30. I.   Description
  31.  
  32.      A vulnerability in the nph-test-cgi script included with some http
  33.      daemons makes it possible for the users of Web clients to read a listing
  34.      of files they are not authorized to read. This script is designed to
  35.      display information about the Web server environment, but it parses data
  36.      requests too liberally and thus allows a person to view a listing of
  37.      arbitrary files on the Web server host.
  38.  
  39. II.  Impact
  40.  
  41.      By exploiting this vulnerability, remote users can read a listing of files
  42.      they are not authorized to read. Access to an account on the system is
  43.      not necessary.
  44.  
  45. III. Solution
  46.  
  47.      We recommend removing or disabling the nph-test-cgi script (see
  48.      Sec. A). If you must keep the script, follow the suggestion in
  49.      Sec. B. All readers should also check Appendix A for information supplied
  50.      by vendors.
  51.  
  52.      A. Remove or disable the script
  53.  
  54.         Some World Wide Web servers include this script by default, but it is
  55.         possible that some sites have installed this script manually.
  56.         Therefore, we encourage all sites to check whether they have this
  57.         script by searching for the file nph-test-cgi in the cgi-bin directory
  58.         associated with their web server.
  59.  
  60.         If you find the script, we urge you to either remove the program
  61.         itself or remove the execute permissions from the program. The
  62.         nph-test-cgi program is not required to run httpd successfully.
  63.  
  64.         Also note that a web server may have multiple cgi-bin directories. It
  65.         is not sufficient to look in the regular location only. For example,
  66.         in the NCSA HTTPd server, you can specify alternate locations for the
  67.         scripts by setting the ScriptAlias directive in the srm.conf file. See
  68.         your vendor's documentation to learn if your sever provides this
  69.         feature. If you are using this feature, you need to remove the
  70.         nph-test-cgi script or apply the workaround below in every cgi-bin
  71.         directory.
  72.  
  73.      B. Modify existing scripts
  74.  
  75.         If you must continue to use this test-cgi script, then we encourage
  76.         you to search for lines of code that echo variables and ensure
  77.         that the variable string to be echoed is quoted. For instance,
  78.         lines of the form:
  79.  
  80.                 echo QUERY_STRING = $QUERY_STRING
  81.  
  82.         should read
  83.  
  84.                 echo QUERY_STRING = "$QUERY_STRING"
  85.  
  86.      C. Vendor Information
  87.  
  88.         Please check Appendix A for information supplied by vendors; we will
  89.         update the appendix as we receive additional information. If you do not
  90.         see your vendor's name, then we did not hear from that vendor. Please
  91.         contact the vendor directly.
  92.  
  93.         Note: Even if your vendor did not ship the nph-test-cgi script,
  94.               you should check your cgi-bin directory in case someone at your
  95.               site added such a script later.
  96.  
  97. IV.  Additional Reading
  98.  
  99.      Several resources relating to Web security in general are available.
  100.      The following resources provide a useful starting point. They include
  101.      links describing general WWW security, secure httpd setup, and secure CGI
  102.      programming.
  103.  
  104.         The World Wide Web Security FAQ:
  105.                 http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
  106.  
  107.         NSCA's "Security Concerns on the Web" Page:
  108.                 http://hoohoo.ncsa.uiuc.edu/security/
  109.  
  110.      The following book contains useful information, including sections on
  111.      secure programming techniques.
  112.  
  113.        _Practical Unix & Internet Security_, Simson Garfinkel and
  114.         Gene Spafford, 2nd edition, O'Reilly and Associates, 1996.
  115.  
  116.      (Note that we provide these pointers for your convenience. As this is not
  117.      CERT/CC material, we cannot be responsible for content or availability.
  118.      Please contact the administrators of the sites if you have difficulties
  119.      with access.)
  120.  
  121. ...........................................................................
  122.  
  123. Appendix A - Vendor Information
  124.  
  125. Below is a list of the vendors who have provided information for this
  126. advisory. We will update this appendix as we receive additional information.
  127. If you do not see your vendor's name, the CERT/CC did not hear from that
  128. vendor. Please contact the vendor directly.
  129.  
  130. Apache
  131. =====
  132.    The latest version of Apache, 1.1.3, does not contain the nph-test-cgi
  133.    cgi-script. The test-cgi script included with Apache 1.1.3 does
  134.    contain the filename globbing bug, but does not ship enabled by
  135.    default.
  136.  
  137.  
  138. Apache-SSL
  139. ==========
  140.    The current version of Apache-SSL is against 1.1.1, and so does not
  141.    suffer from this problem. Also, Apache-SSL is distributed as patches
  142.    to Apache, and so does not, in itself, contain any CGI scripts.
  143.  
  144.  
  145. Stronghold
  146. ==========
  147.    Stronghold 1.3.4 ships with no pre-installed CGI scripts.
  148.  
  149.  
  150. Microsoft
  151. =========
  152.    With regard to NT/IIS we don't ship the script referenced.
  153.  
  154.    Also see recommendations at
  155.       http://www.microsoft.com/intdev and http://www.microsoft.com/pdc
  156.  
  157.  
  158. National Center for Supercomputing Applications
  159. ===============================================
  160.  
  161.    The NCSA(tm) HTTPd comes with a variety of test cgi scripts, including
  162.    nph-test-cgi.  Also included are test-cgi, test-cgi.tcl, and test-env.
  163.    These test scripts are readily identified by the word "test" in their
  164.    names.  They have been provided at the request of our web server community
  165.    to test the server installation and facilitate the development of cgi
  166.    scripts.  When working perfectly they provide private information about the
  167.    server and cgi environment.
  168.  
  169.    Test cgi programs are not intended to be left on an operational server.  If
  170.    using the NCSA HTTPd server for operational use, many configuration issues
  171.    must be addressed.  Among those issues is the use of cgi scripts.  No
  172.    script should be run on a server that has not been carefully reviewed.
  173.    This is especially true for the test scripts, which were never intended to
  174.    be left on an operational server.
  175.  
  176.    Users of NCSA HTTPd should be running the most current version (1.5.2a) to
  177.    ensure that security patches are implemented.  Test cgi scripts should be
  178.    removed from cgi-bin directories before putting a server in operational
  179.    use.
  180.  
  181.    Please see http://hoohoo.ncsa.uiuc.edu/security for further details on
  182.    securely installing the NCSA HTTPd server.
  183.  
  184.    To report security vulnerabilities in NCSA products, email the NCSA
  185.    Incident Response and Security Team (irst@ncsa.uiuc.edu).
  186.  
  187.    NCSA is a trademark of the University of Illinois Board of Trustees.
  188.  
  189.  
  190. - -----------------------------------------------------------------------------
  191. The CERT Coordination Center thanks David Kennedy of the National Computer
  192. Security Association, Ken Rowe of the NCSA(tm) IRST, and Josh Richards for
  193. providing information about this problem.
  194. - -----------------------------------------------------------------------------
  195.  
  196. If you believe that your system has been compromised, contact the CERT
  197. Coordination Center or your representative in the Forum of Incident Response
  198. and Security Teams (see ftp://info.cert.org/pub/FIRST/first-contacts).
  199.  
  200.  
  201. CERT/CC Contact Information
  202. - ----------------------------
  203. Email    cert@cert.org
  204.  
  205. Phone    +1 412-268-7090 (24-hour hotline)
  206.                 CERT personnel answer 8:30-5:00 p.m. EST(GMT-5) / EDT(GMT-4)
  207.                 and are on call for emergencies during other hours.
  208.  
  209. Fax      +1 412-268-6989
  210.  
  211. Postal address
  212.          CERT Coordination Center
  213.          Software Engineering Institute
  214.          Carnegie Mellon University
  215.          Pittsburgh PA 15213-3890
  216.          USA
  217.  
  218. Using encryption
  219.    We strongly urge you to encrypt sensitive information sent by email. We can
  220.    support a shared DES key or PGP. Contact the CERT/CC for more information.
  221.    Location of CERT PGP key
  222.          ftp://info.cert.org/pub/CERT_PGP.key
  223.  
  224. Getting security information
  225.    CERT publications and other security information are available from
  226.         http://www.cert.org/
  227.         ftp://info.cert.org/pub/
  228.  
  229.    CERT advisories and bulletins are also posted on the USENET newsgroup
  230.         comp.security.announce
  231.  
  232.    To be added to our mailing list for advisories and bulletins, send
  233.    email to
  234.         cert-advisory-request@cert.org
  235.    In the subject line, type
  236.         SUBSCRIBE  your-email-address
  237.  
  238. - ---------------------------------------------------------------------------
  239. Copyright 1997 Carnegie Mellon University
  240. This material may be reproduced and distributed without permission provided
  241. it is used for noncommercial purposes and the copyright statement is
  242. included.
  243.  
  244. CERT is a service mark of Carnegie Mellon University.
  245. - ---------------------------------------------------------------------------
  246.  
  247. This file: ftp://info.cert.org/pub/cert_advisories/CA-97.07.nph-test-cgi_script
  248.            http://www.cert.org
  249.                click on "CERT Advisories"
  250.  
  251.  
  252. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  253. Revision history
  254.  
  255. February 21, 1997  Acknowledgements - corrected organization names.
  256.  
  257. -----BEGIN PGP SIGNATURE-----
  258. Version: 2.6.2
  259.  
  260. iQCVAwUBMw4EFHVP+x0t4w7BAQG/awQAz/0bxgpFffdWh9FVMM8Fp9J45swP+/ZS
  261. LY4ujfQVm5n8Qibxhy8Vk4ZhCRLO7pPE7X9PRuSm8MQF2ZWirttHhdVs1eK/8WrA
  262. +HSo+Y1HXoybDr7wN7Sprn0d4ss5xM/VQHDsmOTtikq+FHEq6CvBf+2J8gqygFU1
  263. HOYspVfMQ9E=
  264. =qGBy
  265. -----END PGP SIGNATURE-----
  266.  
  267.