L0pht Advisory: NT IIS 4.0 - showcode file viewing vulnerability

From: Weld Pond (weldat_private)
Date: Fri May 07 1999 - 07:28:41 PDT

  • Next message: Kevin Day: "Re: KKIS.05051999.003b"

                   L0pht Security Advisory
    
    -------------
    URL Origin:    http://www.l0pht.com/advisories.html
    Release Date:  May 7th, 1999
    Application:   Microsoft IIS 4.0 Web Server
    Severity:      Web users can view ASP source code and other sensitive
                   files on the web server
    Author:        weldat_private
    Operating Sys: Microsoft NT Server 4.0
    --------------
    
    I. Description
    
    Internet Information Server (IIS) 4.0 ships with a set of sample files
    to help web developers learn about Active Server Pages (ASP).  One of
    these sample files, showcode.asp, is designed to view the source
    code of the sample applications via a web browser. The showcode.asp
    file does inadequate security checking and allows anyone with a web
    browser to view the contents of any text file on the web server.  This
    includes files that are outside of the document root of the web
    server.
    
    Many ecommerce web servers store transaction logs and other customer
    information such as credit card numbers, shipping addresses, and
    purchase information in text files on the web server.  This is the
    type of data that could be accessed with this vulnerability.
    
    The L0pht would like to thank Parcens for doing the initial research on
    this problem.
    
    II. Details
    
    The showcode.asp file is installed by default at the URL:
    
    http://www.someserver.com/msadc/Samples/SELECTOR/showcode.asp
    
    It takes 1 argument in the URL, which is the file to view. The format of
    this argument is:
    
    source=/path/filename
    
    So to view the contents of the showcode.asp file itself the URL would be:
    
    http://www.someserver.com/msadc/Samples/SELECTOR/showcode.asp?source=/msadc/Samples/SELECTOR/showcode.asp
    
    This looks like a fairly dangerous sample file. It can view the contents
    of files on the system. The author of the ASP file added a security check
    to only allow the viewing of the sample files which were in the '/msadc'
    directory on the system. The problem is the security check does not test
    for the '..' characters within the URL.  The only checking done is if the
    URL contains the string '/msadc/'.  This allows URLs to be created that
    view, not only files outside of the samples directory, but files anywhere
    on the entire file system that the web server's document root is on.
    
    For example, a URL that will view the contents of the boot.ini file, which
    is in the root directory of an NT system is:
    
    http://www.someserver.com/msadc/Samples/SELECTOR/showcode.asp?source=/msadc/Samples/../../../../../boot.ini
    
    This URL requires that IIS 4.0 was installed in its default location.
    
    
    III. Solution
    
    For production servers, sample files should never be installed so delete
    the entire /msadc/samples directory.  If you must have the showcode.asp
    capability on development servers the showcode.asp file should be modified
    to test for URLs with '..' in them and deny those requests.
    
    
    For specific questions about this advisory, please contact
    weldat_private
    
    ---------------
    For more L0pht (that's L - zero - P - H - T) advisories check out:
    http://www.l0pht.com/advisories.html
    ---------------
    



    This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 14:45:11 PDT