Recursing the JavaScript eval function over itself eventually causes all dialogs with confirmation to evaluate to "true".
Originally disclosed on Mozilla
- Fixed in 32 days
- Paid in 2.6 years
- Disclosed after 32 days
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
Build Identifier: http://www.mozilla.com/en-US/products/download.html?product=firefox-3.6.12&os=win&lang=en-US
Obviously, code like eval(a="eval(a)") causes the script to error out. But adding a try/catch block like eval(a="try{eval(a)}catch(b){/*code here*/}") lets you catch the "eval'd-out" state and execute code in it. Any dialog box opened in this state instead shows a textless dialog box with two textless buttons, and pressing these buttons does not close this box. Closing the box with the corner "X" button causes input boxes (confirm, onbeforeunload, netscape.security.PrivilegeManager.enablePrivilege, etc.) to evaluate to "true".
Reproducible: Always
Steps to Reproduce:
The following code will open a dialog: eval(a="try{eval(a)}catch(b){c=confirm('You will not see this text')}")
Actual Results:
In Windows 7, the only immediate way to close the aforementioned dialog is by pressing the "X" corner button. If the user performs this action, Firefox will proceed as if the user pressed "OK", causing c == true.
Expected Results:
In a normal case, this action is the equivalent of pressing "Cancel", meaning c == false.
See the attachment in the comments for an example that uses this vulnerability for arbitrary code execution.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A security bug in DOM: Core & HTML. Mozilla made it public on 5 January 2011 as CVE-2011-0051.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.