Holding enter allows arbitrary code execution due to Download Manager
Originally disclosed on Mozilla
- Fixed in 7 months
- Paid in 2.2 years
- Disclosed after 7 months
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
It is possible to execute an arbitrary code in the context of user's operating system if a user holds Enter for about 1-2 seconds. Consider the attached example -- a file download prompt pops up and a user has only about a second to react (with the default Firefox settings -- it could be a fraction of second more if the option to always ask where to save files was explicitly selected). If they keep holding Enter and there was no "Downloads" window on the task bar prior to the prompt (thus the newly appearing "Downloads" window with the malicious file highlighted gains focus), an arbitrary code will be executed. No user interaction other than holding Enter is needed for a successful exploitation of this issue. The windows appear in a very brief instant and an attacker can use a number of methods to easily distract user's attention to make them hold the crucial key a fraction of second longer.
I think that the primary problem here is that the keyboard buffer isn't maintained correctly when the download prompt gains focus. It should be flushed and no new keys should be registered until after all keys are released.
Reproducible: Always
Steps to Reproduce:
1. Open script.htm
2. Press and hold Enter.
Actual Results:
calc.exe starts.
Expected Results:
No file should be launched without an explicit consent from the user.
The attached example has been verified to launch calc.exe in Firefox 4.0.1 on Windows 7 SP1 64-bit and Windows XP SP2 32-bit.
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 RCE bug in Downloads API. Mozilla made it public on 7 December 2011 as CVE-2011-2372.
About RCE
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.