By GreyMagic Software, Israel.
17 Jun 2003.

Topic: Script Injection to Custom HTTP Errors in Local Zone.
Discovery date: 18 Feb 2003.
Affected applications: Microsoft Internet Explorer 5.01, 5.5 and 6.0.

Note that any other application that uses Internet Explorer's engine (WebBrowser control) is affected as well (AOL Browser, MSN Explorer, etc.).

Introduction: Internet Explorer ships with various internal HTML resource files. The majority of these files are meant to handle custom HTTP errors in web sites (also called "Friendly HTTP error messages"). They all use the same basic pieces of code, with minor changes to the actual content of each resource.
One of the main functions included in the resources is a method to extract the real URL from the resource URL hash. For example, if "" generated a 404 HTTP error, the following URL will be internally requested by IE: res://shdoclc.dll/404_HTTP.htm#
The function takes the part after the # sign and attempts to extract the domain of the site, in order to embed it in the content of the custom message.

Discussion: We found that the above-mentioned parsing procedure has a flaw in it that may cause arbitrary script commands to be executed in the Local Zone. Leading to potential arbitrary commands execution, local file reading and other severe consequences.
However, Exploiting this procedure requires user-interaction. The user must click the URL presented to it by the resource for the malicious code to execute.
Here is the vulnerable function, precisely as it appears in the resources: