Users login

Create an account »

JOIN XATRIX

Users login

Home » Hacking News » .htr heap overflow in IIS 4.0 and 5.0

.htr heap overflow in IIS 4.0 and 5.0

by Nikola Strahija on April 10th, 2002 In the default IIS installation, .htr functionality is enabled. .htr files are used only for for web-based password resets. There exists a heap overflow in the server component that is used to handle requests to .htr files.


As with most heap overflows, this heap overflow can be used to execute
arbitrary machine code. In the default installation, this results in
remote execution in the IUSR_machine security context.

This vulnerability has been verified on IIS 4.0 and 5.0 with SP2 and
the latest security patches as of April 1, 2002.


Description:

IIS supports many different file types, such as .htr, that require
server side processing. When IIS recieves a request for a file with the
.htr extension, the request is handled by a ISAPI extension, ISM.DLL.

When a file request is recieved by IIS it checks the script mappings to
check if the extension on the file in the request matches an extension
in the script mappings. If it does it passes the request on to an
ISAPI extension for further processing. .htr files do not actually need
to be present on the system for the request to be handled by ISM.DLL.

Script mappings are configured with the IIS administrative interface.
.htr files are mapped to the ISM.DLL by default so a default IIS 4.0 or
5.0 installation is vulnerable. A recommended security practices is
to unmap all script mappings that are not being used. This is
documented in Microsoft's IIS Security Checklist:

IIS 4.0
http://www.microsoft.com/technet/security/tools/chklist/iischk.asp

IIS 5.0
http://www.microsoft.com/technet/security/tools/chklist/iis5chk.asp

This follows the security best practice of attack surface reduction.
In general this is accomplished by disabling all functionality that is
not required to accomplish the specific tasks for which a product is
being used.

Once the request is passed on to the ISM.DLL ISAPI filter, a specific
request causes a heap overflow to occur during processing. This
heap overflow, as with most heap overflows, is exploitable to run
arbitrary code on the machine in the user context that ISM.DLL is
running. By default this user context is IWAM_computername.

The IUSR_computername user context does not allow administrative
access so the machine cannot be completely compromised by this
vulnerability alone. Remote attackers can execute arbitrary code which
does allow for the creation of a network worm or the execution of a
remote control program. The risk to machines that have not been
patched or reconfigured is very high.


Vendor Response:

The vendor has issued a bulletin on this issue:

http://www.microsoft.com/technet/security/bulletin/MS02-018.asp

The vendor has issued patches for this issue:

Microsoft IIS 4.0:
http://www.microsoft.com/Downloads/Release.asp?ReleaseID=37931

Microsoft IIS 5.0:
http://www.microsoft.com/Downloads/Release.asp?ReleaseID=37824



Recommendations:

Apply the vendor patches.

You can check to see if you are potentially vulnerable by searching for
ISM.DLL. Be aware that IIS is installed as part of other Microsoft
products. Run the IIS administrative program and check script mappings.
Disable .htr functionality by unmapping the .htr extention except for
the
rare case that you are using the web-based password reset feature of
IIS.


Common Vulnerabilities and Exposures (CVE) Information:

The Common Vulnerabilities and Exposures (CVE) project has assigned
the following names to these issues. These are candidates for
inclusion in the CVE list (http://cve.mitre.org), which standardizes
names for security problems.

.htr IIS Server vulnerability: CAN-2002-0071


Reporter Disclosure Policy:

This advisory is being issued in accordance with the Responsible
Vulnerability Disclosure Process available at:

http://www.ietf.org/internet-drafts/draft-christey-wysopal-vuln-disclosu
re-00.txt


For more advisories: http://www.atstake.com/research/advisories/
PGP Key: http://www.atstake.com/research/pgp_key.asc


Newsletter signup

Signup to our monthly newsletter and stay in touch with IT news!

Free E-books

We've got ebooks! But they're not online. :( Please give us a few days to bring downloads back.

Contact

Have something to say or just wanna drop us a line? Please keep this in mind: to spam, we reply with spam.

Contact us »