No clickjacking delay for the Directory Upload prompt
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: fazim.pentester, Assigned: emz)
References
Details
(Keywords: csectype-clickjacking, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][adv-main131+][adv-esr128.3+])
Attachments
(7 files)
|
738 bytes,
text/html
|
Details | |
|
2.55 KB,
text/html
|
Details | |
|
936.86 KB,
video/mp4
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
|
208 bytes,
text/plain
|
Details |
Firefox has implemented delays to counter clickjacking attacks on various UI prompts. However, during testing, the directory upload prompt does not include this delay. An attacker could create an engaging website that involves a clicking game, where the user repeatedly clicks in the same location. This could trigger two prompts: one for the OS's directory upload (where the "Upload" button is preselected and active) and another Firefox prompt. Without a delay in the browser's prompt, the user could unknowingly upload all their files to the attacker's site. See demo.
I demonstrated this on a macOS machine, though the same prompt on Windows also lacks this security measure. While the Windows file chooser may appear in different areas depending on user last placement, the macOS prompt consistently opens in a predictable center location every time.
Steps to reproduce:
- Download the attached
poc.htmlandpopup.htmlfiles. - Open the
poc.htmlfile in the latest macOS Firefox browser. - Click on 'Play Game' and repeatedly click on the red button to see that the user's directory is unknowingly uploaded.
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
|
||
Video Demonstration.
Comment 3•1 year ago
|
||
The test case uses webkitdirectory in case that matters.
Comment 4•1 year ago
|
||
Isn't this the same OS dialog as the normal single-file upload case? I don't know that we can implement a delay in that.
Not visible (to me) in your movie is the extra confirmation prompt about uploading the whole directory. That one's ours and does seem to be missing the delay.
Comment 5•1 year ago
|
||
This is about <input type=file>, not the File APIs
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Paul, is this something you might be interested in looking at? The setup is a bit janky, but if you pull it off it seems bad, and hopefully we have standard fixes for this thing. Thanks.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 8•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 9•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D222629
Updated•1 year ago
|
Comment 10•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: sec-moderate clickjacking issue that exposes files from the local machine
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: See comment 0
- Risk associated with taking this patch: low
- Explanation of risk level: Low risk because the production code change is very simple.
- String changes made/needed: no
- Is Android affected?: no
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Please nominate this for ESR128 also.
Updated•1 year ago
|
Comment 14•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 15•1 year ago
•
|
||
I was able to reproduce this issue on macOS 13.2.1 using Fx 130.0 -> the "Upload" button from the Firefox prompt is already active(there is no delay before activating the button). The files can be uploaded by mistake on click.
Verified fixed on macOS 13.2.1 using the treeherder builds : Fx 131.0b9 and Nightly 132.0a1(2024-09-19) -> there is a delay(~3s) before activating the "Upload" button from the Firefox prompt.
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Comment 16•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D222629
Updated•1 year ago
|
Comment 17•1 year ago
|
||
esr128 Uplift Approval Request
- User impact if declined: clickjacking risk where users might involunarily expose a local directory and its files
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: yes
- Steps to reproduce for manual QE testing: comment 0
- Risk associated with taking this patch: low
- Explanation of risk level: small production code change
- String changes made/needed: no
- Is Android affected?: no
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 18•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Comment 19•1 year ago
|
||
Verified fixed on macOS 13.2.1 using Fx 128.3.0 esr there is a delay(~ 2 - 3s) before activating the "Upload" button from the Firefox prompt.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 20•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•10 months ago
|
Description
•