User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:18.104.22.168) Gecko/20071025 Firefox/22.214.171.124
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:126.96.36.199) Gecko/20071025 Firefox/188.8.131.52
It's possible to set focus on a file field if a file field and a text field are both embedded into a single label. Result is that the focus of the textfield gets transfered to the file field, which can result in uploading sensitive files from a users PC.
Steps to Reproduce:
1. goto http://www.0x000000.com/index.php?i=479
2. copy/paste in html file
3. run, type into the text field.
focus is set on the file field.
focus remaining on the text field.
Created attachment 289369 [details]
What's the exploit? It's already known that it's possible to manually focus the input in an <input type=file> on the branch (you don't need any fancy tricks, users can just tab to it). The previous problems were mainly related to programmatically changing focus as the user types to mislead them into typing something into the input, I'm not sure I see how this issue could be used to do that.
*sigh* this does exactly the same.
of course it's possible to steal user typed data, no creative mind or what? Think about that for a while, I was kind enough not to release actual code to exploit it. I know about the previous issue, I found the same in MSIE, only differently.
Consider this the first and last post on Bugzilla with such stupid answers, waste of my time.
You can also obscure the "Browse..." button by covering it, making the file upload control look like a normal text field. That's been known for a long time. See bug 57770, for example.
There might be a bug here with how <label> interacts with multiple form fields, but it's not a security hole.
If you do have an exploit, please do file a new (security-sensitive) bug report with it, so we can know what you're talking about :)
(In reply to comment #3)
> *sigh* this does exactly the same.
Exactly the same as what? The previous exploits related to file inputs were based on masking the fact users were typing in filenames (e.g. by selectively changing focus, retargeting events, etc). I don't see a way to do that with this testcase; seems to me like it has the same effect as getting the user to press "tab".
You can call me stupid if you want, but my comment was a question, not an answer. I don't understand why you think this testcase is dangerous, and if you don't want to explain it to me that's up to you, I guess.
I couldn't tell if a sample exploit had already been submitted by the
original reporter, so I thought I would submit what I had.
Exploit example attached to bug 404451.
Gregory and tha featurizer - thanks for the info on this bug. Given the data in bug 404451 I'm removing this bug from the blocking list and we'll evaluate bug 404451 separately.
Fixed on the 1.8 branch by bug 405299
This bug is verified by the verification in bug 404451 and bug 405299 which show sample exploits for this bug.
Also verified that this testcase now focuses the "Browse" button instead of the text field.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:184.108.40.206) Gecko/2008012820 Firefox/220.127.116.11