Closed
Bug 405299
Opened 18 years ago
Closed 18 years ago
Firefox file input focus stealing through label element dispatch mouse click event
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: yathong, Assigned: smaug)
References
()
Details
(Keywords: fixed1.8.0.15, testcase, verified1.8.1.12, Whiteboard: [sg:moderate])
Attachments
(2 files)
1.11 KB,
text/html
|
Details | |
2.41 KB,
patch
|
jst
:
review+
bzbarsky
:
superreview+
dveditz
:
approval1.8.1.12+
asac
:
approval1.8.0.next+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-TW; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; zh-TW; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Focus change allowed between onKeyDown and onKeyPress, allowing attacker to read arbitary files.
This is similar to bug 388784, but it is using label to dispatch mouse click event to change focus to textfield of file input object.
I verified this with Firefox 2.0.0.9
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 2•18 years ago
|
||
This is a duplicate of bug 404451.
![]() |
||
Comment 3•18 years ago
|
||
Not quite. This bug doesn't rely on a user click to focus the wrong control; it actually focuses the file by focusing the label, then puts the focus back. I thought we'd prevented that with the label changes on branch....
The fix for bug 404451 might fix this, of course.
Assignee | ||
Comment 4•18 years ago
|
||
Taking. I have patch for this but it doesn't yet fix bug 404451.
Assignee: nobody → Olli.Pettay
Assignee | ||
Updated•18 years ago
|
Flags: blocking1.8.1.12?
Assignee | ||
Comment 5•18 years ago
|
||
I can't think of any solution which wouldn't change the behavior a bit.
The patch makes it so that clicking something in <label> has similar behavior as
calling label.focus(), meaning that input element is handled in a special way.
To keep changes in behavior as small as possible, ::SetFocus is modified to
check only type="file", not all input elements.
Although this is a small patch, I'd like to get 2 separate reviews for this.
Just in case someone comes up with some better solution.
Attachment #290682 -
Flags: review?(jst)
Comment 6•18 years ago
|
||
Comment on attachment 290682 [details] [diff] [review]
possible patch
Looks reasonable to me. Do we need something similar for trunk too?
r=jst, it'd probably be good if bz could look at this as well.
Attachment #290682 -
Flags: review?(jst) → review+
Assignee | ||
Comment 7•18 years ago
|
||
Comment on attachment 290682 [details] [diff] [review]
possible patch
On trunk <input type="file"> works in a different way. There typing to the textfield isn't possible.
Attachment #290682 -
Flags: superreview?(bzbarsky)
![]() |
||
Updated•18 years ago
|
Attachment #290682 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Updated•18 years ago
|
Attachment #290682 -
Flags: approval1.8.1.12?
Updated•18 years ago
|
Flags: blocking1.8.1.12? → blocking1.8.1.12+
Whiteboard: [sg:high]
Updated•18 years ago
|
Comment 9•18 years ago
|
||
Comment on attachment 290682 [details] [diff] [review]
possible patch
approved for 1.8.1.12, a=dveditz for release-drivers
Attachment #290682 -
Flags: approval1.8.1.12? → approval1.8.1.12+
Updated•18 years ago
|
Flags: wanted1.8.1.x+
Updated•18 years ago
|
Assignee | ||
Updated•18 years ago
|
Keywords: fixed1.8.1.12
Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Flags: in-testsuite?
Updated•18 years ago
|
Whiteboard: [sg:high] → [sg:moderate]
Comment 10•18 years ago
|
||
Verified for branch with Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12pre) Gecko/2008011803 BonEcho/2.0.0.12pre and Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12pre) Gecko/2008011803 BonEcho/2.0.0.12pre.
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1.12 → verified1.8.1.12
Updated•18 years ago
|
Group: security
Comment 12•17 years ago
|
||
Comment on attachment 290682 [details] [diff] [review]
possible patch
a=asac for 1.8.0.15
approving unmodified distro patch.
Attachment #290682 -
Flags: approval1.8.0.15+
Comment 13•17 years ago
|
||
MOZILLA_1_8_0_BRANCH:
Checking in content/html/content/src/nsHTMLLabelElement.cpp;
/cvsroot/mozilla/content/html/content/src/nsHTMLLabelElement.cpp,v <-- nsHTMLLabelElement.cpp
new revision: 1.87.6.1.2.2; previous revision: 1.87.6.1.2.1
done
Keywords: fixed1.8.0.15
You need to log in
before you can comment on or make changes to this bug.
Description
•