Microsoft IIS / Site Server showcode.asp source Parameter Traversal Arbitrary File Access

high Nessus Plugin ID 10007

Synopsis

It is possible to read arbitrary files on the remote host.

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' (installed in /msadc/Samples/SELECTOR/), 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.

The 'showcode.asp' file is installed by default at the URL:
http://www.YOURSERVER.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

This is a fairly dangerous sample file since it can view the contents of any other files on the system. The author of the ASP file added a security check to only allow 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.

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 a development server, the 'showcode.asp' file should be modified to test for URLs with '..' in them and deny those requests.

See Also

http://www.nessus.org/u?16ba761f

Plugin Details

Severity: High

ID: 10007

File Name: ShowCode.nasl

Version: 1.43

Type: remote

Family: CGI abuses

Published: 7/8/1999

Updated: 1/19/2021

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 4.4

CVSS v2

Risk Factor: High

Base Score: 7.8

Temporal Score: 6.1

Vector: CVSS2#AV:N/AC:L/Au:N/C:C/I:N/A:N

Vulnerability Information

Required KB Items: www/ASP

Exploit Ease: No exploit is required

Vulnerability Publication Date: 5/7/1999

Reference Information

CVE: CVE-1999-0736

BID: 167