Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I click to download a file through Firefox, a dialog window appears asking me whether I want to save the file somewhere or open it immediately once downloaded.

Screenshot of a Firefox download dialog

The OK button in the dialog window starts disabled, and doesn't enable until the dialog has had focus for around a second. The dialog isn't modal, and if I focus on another window the OK button will disable and again won't re-enable until the window has held focus for a second.

My partner lamented at this design, and asked me why she couldn't just click OK to download immediately - I responded that I've always thought it was a security feature. Now that I think about it however, I'm not certain exactly what behavior it could be preventing. I would have thought that it might prevent some malicious website from downloading a file secretly by forcing the download window to stay open for at least long enough to see whats going on - however it should be possible for a site to download stuff secretly in the background anyway. Regardless I presume most users would have clicked the 'do this automatically from now on' box at some point, and thus be unprotected anyway...

So, is this a security feature? If so what does it protect against?

share|improve this question
    
I kinda thought it was probably some strange piece of slowness caused by inefficiency by whoever developed the specific code by Firefox. If Firefox had it clear that the delay was intentional, such as changing the value of the button to say "OK in 3..." and show a countdown, then at least I would have understood that this was clearly intentional behavior. – TOOGAM Mar 26 at 16:09
up vote 320 down vote accepted

Yes, it is a security feature, and the purpose of the delay is to prevent attacks based around tricking the user into entering input to skip past the dialog by popping it up unexpectedly when the user is in the middle of inputting multiple key presses or mouse clicks in quick succession. The two examples that are given in this blog post explaining the feature are:

  • A CAPTCHA that asks the user to type the word only. When they press n, a save dialog is popped up, and then the user will immediately press l and then y, which is the keyboard shortcut for OK on some browsers, unintentionally confirming the download
  • A webpage that convinces the user to double-click somewhere on screen, positioned so that when the dialog opens after the first click, their mouse pointer is right over the "OK" button, meaning that they immediately confirm it.

By disabling the button for several seconds, the input has no effect.

Mozilla bug report about the issue

share|improve this answer
17  
Also user can use extra time to actually check file name/type. Without ad-block you can accidentally download some evil .exe instead of actual content. I have not experienced input trick myself yet, but from time to time I delete "evil toolbar [32].exe" from my download folder ;) – PTwr Mar 21 at 9:21
7  
I'm finally enlightened. – PandaLion98 Mar 21 at 11:55
78  
This an excellent answer and I just want to further add that users can also become numb to pop-up messages and confirmations. I would imagine that this slight delay can help mitigate those that have become numb. Anecdote: I was showing my dad how to use the web browser on an Android phone recently and some pop-up appeared and he hastily clicked OK; without a moment to spare he turns to me and asks "What did that say?". I am 95% confident that it had something to do with an expired SSL cert but we shall never know for certain. – MonkeyZeus Mar 21 at 15:52
4  
@MonkeyZeus That's pretty interesting behaviour. Did you ask why he clicked before reading it, since he apparently wanted to know what it was? – pipe Mar 21 at 18:00
18  
@pipe I may have inadvertently provoked his question "What did that say?" because I'm sure I gasped or muttered "wait" under my breath. Nevertheless, I think it still demonstrates the pop-up numbness. – MonkeyZeus Mar 21 at 18:31

Let's imagine that there's no delay, the default action for executable files is to open it, and there's some delay before the page requests the file download. In theory, you could accidentally run a virus if you were typing something at the exact time the dialog popped up. Incredibly rare, but I'm sure it's happened to someone somewhere.

Less maliciously, from a user experience standpoint, the user might be in the middle of pressing space or Enter right when the dialog pops up, therefore accepting the default, and possibly incorrect, action. The short delay prevents the user from accidentally selecting the wrong option.

While I doubt this feature was actually meant to protect anything (I'd rather trust my antivirus to that task), I find that I'm less likely to accidentally do the wrong thing with the file when the UI flushes my input and makes sure I actually meant to perform some action.

share|improve this answer
6  
Firefox never executes an exe file, at least not from that dialog. – David Balažic Mar 21 at 15:48
    
It's only happened to me once that I can recall, but I definitely had a dialog appear once as I was typing, with exactly the right timing to catch my spacebar. I have no idea what it said. – Dan Henderson Mar 23 at 21:35
    
"I'd rather trust my antivirus to that task" - I'd sooner try to avoid the problem occurring in the first place than rely on antivirus to clean up afterwards. (In other words, I would prefer a UI that helps to avoid drive-by-downloads than one that lets them happen and relies on antivirus software to stop them from doing any damage.) – Micheal Johnson Mar 27 at 11:49

There is one thing that none of the other answers have mentioned: many users click OK and download without reading the popup window.

If a user were to download a malicious file accidentally (or was tricked into doing so), and clicks OK on instinct without reading and checking the file they are downloading, then they could miss important security information such as the size, filetype extension and location of the file about to be downloaded.

By disabling the OK for a few seconds, Firefox forces users to think twice and check what they are downloading.

share|improve this answer
4  
Do you have any proof or is it just a pure guess that disabling the button for a few seconds makes users read the message? I am asking because there are dialogs intended to force users to read the contents like approving invalid certificate or agreeing to a license agreement. They use methods other than delay. – techraf Mar 22 at 6:46
    
@techraf I do not have any proof (as in research papers etc) however from my own experience (I used to click OK all the time until I started using FF) and watching other FF first-timers (they do seem to actually read the popup after their first click) I can confirm that it does work. Note that one of the answers in the question that MonkeyZeus linked to (under the accepted answer) states that breaking the flow of an application by introducing a delay or an additional step does make the user read. – angussidney Mar 22 at 7:20
    
@techraf, What is the user to do in that second of delay... They will be looking at the dialog, and their brain will visualise the words, which may proceed to their consciousness sufficiently that they find themselves 'reading' some part of it. Or they could screw their eyes shut to be deliberately obtuse ;-) As long as the delay is sufficient to make the user 'sigh', and then click in a considered manner it's an improvement (in my risk/reward trade-off view). – Philip Oakley Mar 25 at 12:45
    
@PhilipOakley Do you have any a reference to research results? – techraf Mar 25 at 12:49
    
@techraf, unfortunately I don't have any specific references. Though there is lots of commentary about 'Lucky' people studies that show those with 'eyes open' (i.e. a wider view) and more lucky. As with most of these studies they are 'tricks'. You are asked one thing while they study another, e.g. read paper to see how often a sports person is mentioned but actually see if they notice the 'free money if you tell the researcher advert'!. Plus, the opposite postulate (screw up eyes) is clearly false, though they may just stare intently at the Ok button till it's no longer greyed out. Unlucky. – Philip Oakley Mar 25 at 15:12

Some programs can invoke keypresses into your web browser. Take a look at VBScript's SendKeys() method.

This method sends keys to the currently focused window, and can send buttons such as ALT, TAB, and/or ENTER.

In a Windows Forms Application, a malicious developer can implement the SendKeys.Send() method and do some bad stuff, such as Alt-tab over to Firefox and click "Ok" on a malicious download link.

share|improve this answer
7  
If they're at the stage where you're running their VBScript or Windows Form Application then they already have control of your computer and wouldn't need Firefox or any other browser to get more stuff on there – Matthew Steeples Mar 24 at 9:37
    
also, they could avoid this by enabling the button from code – beppe9000 Mar 25 at 11:59
    
Can't a page have VBScript embedded in it like a page can run JavaScript? Or, even, can't JavaScript access the same methods? – DDPWNAGE Mar 29 at 23:06
1  
@DDPWNAGE No. VBScript only ever worked in-browser in IE, and not even in IE11's Edge rendering mode. Even then, functions like SendKeys() never worked in browsers as far as I know, only in Windows Script Host. Just like you have a lot more access from a Node.js script than JS in the browser. The libraries and functionality is available in addition to the core language, and are only available in specific environments. – Bob Apr 1 at 1:08

I believe this is to make sure user see the dialog.
There are more attack vectors than the user typing trick that already described in other answers.
For instance USB HID based hacks. This is just some measure against both known and unknown attack vectors. Not just to patch particular set of known threat.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.