Security bug Clickjacking to allow permission using datepicker
Categories
(Toolkit :: PopupNotifications and Notification Bars, defect)
Tracking
()
People
(Reporter: sas.kunz, Assigned: emz)
Details
(Keywords: csectype-clickjacking, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][adv-main129+][adv-ESR115.14+][adv-ESR128.1+])
Attachments
(12 files, 1 obsolete file)
|
2.21 MB,
video/mp4
|
Details | |
|
1.03 KB,
text/html
|
Details | |
|
254.27 KB,
image/jpeg
|
Details | |
|
260.52 KB,
image/jpeg
|
Details | |
|
2.74 MB,
video/mp4
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
dmeehan
:
approval-mozilla-esr115+
dmeehan
:
approval-mozilla-esr128+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
1.86 MB,
video/mp4
|
Details | |
|
1.67 MB,
video/mp4
|
Details | |
|
1.57 MB,
video/mp4
|
Details | |
|
1.84 MB,
video/mp4
|
Details | |
|
207 bytes,
text/plain
|
Details |
when selecting a date on the datepicker and the datepicker closes because it changes focus to another input this causes clickjacking at the permission prompt
steps to reproduce:
- open dtclickjacking.html
2.do many Click on "next month" button
Operating System : Windows 10
Firefox version : Firefox Developer version 128.0b4 (64-bit)
| Assignee | ||
Comment 2•1 year ago
|
||
Talked about this with Gijs, we suspect that the timeShown property used for the clickjacking protection is set too early and not close enough to the actual panel show. If you look at https://searchfox.org/mozilla-central/rev/8011b6325f7ce05d228a3cdefd45d74fb98ee7b4/toolkit/modules/PopupNotifications.sys.mjs#1297,1369 you can see that in the first marked line we set timeShown. On the second marked line the actual panel show happens (popupshown). We should check if moving the timeShown assignment into that listener fixes the issue.
We weren't able to reproduce it ourselves, potentially because our hardware is faster and the panel opens up faster. There is also a transition / animation for the panel showing which may further slow down things.
Comment 3•1 year ago
|
||
Do we know the length of time for the animation? If so we should add that time to the default timeout. It's not fully visible during the transition so that bit shouldn't count against the delay value.
I couldn't reproduce either -- my initial clicks on the permission prompt were inactive and did nothing. Note: I had to play with the width of my window to get the click targets to line up. Obviously won't work in a real attack, but I assume you could probably calculate resolutions and screen geometries and platforms to get pretty close in the general case.
Comment 4•1 year ago
|
||
Hafiish: what kind of system are you running the PoC on in the movie? Is it old/slow?
i used HP elitebook 830 G6 with specification:
Processor: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz
Installed RAM : 16,0 GB (15,8 GB usable)
System type: 64-bit operating system, x64-based processor
Windows specifications:
Edition: Windows 10 Pro
Version: 22H2
OS build: 19045.4529
Experience: Windows Feature Experience Pack 1000.19058.1000.0
| Assignee | ||
Comment 7•1 year ago
|
||
I don't know how long the animation takes or where that code lives. I'm not convinced that adding the animation time to the timeout is a good fix. It's also possible this animation takes longer on slow machines.
I'll check if we can move timeshown even close to actual panel now. I recall we tried something like this in the past and ran into issues with prompts / the timeout breaking, so we need to be careful.
| Assignee | ||
Comment 8•1 year ago
|
||
Could you test if you can still reproduce with this Firefox build: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/LwNmAd7uRXW2N6eHSj1Feg/runs/0/artifacts/public/build/target.zip
To run it just extract the zip and execute firefox.exe.
If the issue persists with this build we most likely need a more general solution for panels overlaying permission prompts. We should hide the datepicker once the permission prompt appears. Bug 1901685 is doing some groundwork for that.
| Assignee | ||
Comment 10•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 11•1 year ago
|
||
Thanks Dan! I'll land this after the soft code freeze.
Comment 12•1 year ago
|
||
Comment 13•1 year ago
|
||
Updated•1 year ago
|
Comment 14•1 year ago
|
||
The patch landed in nightly and beta is affected.
:pbz, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox129towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 15•1 year ago
|
||
Let's leave this in Nightly for a bit longer before uplifting. I want to mitigate the risk of regressions. I've set a reminder in 7 days.
Updated•1 year ago
|
| Assignee | ||
Comment 16•1 year ago
|
||
Comment on attachment 9410842 [details]
Bug 1903187, r=Gijs!
Beta/Release Uplift Approval Request
- User impact if declined: Clickjacking on permission prompts via datepicker
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See comment 0
Note that engineering couldn't reproduce the original issue, but it's worth trying again. Overall we should make sure that the patch didn't break permission prompts in any way - particularly:
- accepting a permission prompt during the first 500ms of it showing should not be possible
- After 500ms permission prompts should be acceptable / rejectable via the buttons.
- List of other uplifts needed: None
- Risk to taking this patch: Medium
- Why is the change risky/not risky? (and alternatives if risky): Medium risk since we're changing how the PopupNotifications security delay is calculated. The delay disables the accept / reject buttons. Introducing a bug in that logic would mean the buttons can not be used and the prompt can not be closed / accepted properly and permission requests can't be granted.
- String changes made/needed: none
- Is Android affected?: No
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: It's a sec-medium. No special considerations.
- User impact if declined: Clickjacking on permission prompts via datepicker
- Fix Landed on Version: 30
- Risk to taking this patch: Medium
- Why is the change risky/not risky? (and alternatives if risky): Medium risk since we're changing how the PopupNotifications security delay is calculated. The delay disables the accept / reject buttons. Introducing a bug in that logic would mean the buttons can not be used and the prompt can not be closed / accepted properly and permission requests can't be granted.
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 17•1 year ago
|
||
Comment on attachment 9410842 [details]
Bug 1903187, r=Gijs!
Approved for 129.0b6
Comment 18•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 19•1 year ago
|
||
Comment on attachment 9410842 [details]
Bug 1903187, r=Gijs!
Approved for 128.1esr.
Comment 20•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Comment 21•1 year ago
•
|
||
:pbz, this doesn't graft cleanly to ESR115 due to Bug 1872993. Could you attach a rebased patch?
| Assignee | ||
Comment 22•1 year ago
|
||
| Assignee | ||
Comment 23•1 year ago
|
||
I've attached a patch for ESR 115, just waiting for review.
Comment 24•1 year ago
|
||
A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)
Comment 25•1 year ago
|
||
I cannot reproduce this issue on may main system, in an "affected" build either: Tested in Beta v128.0b4 and Devedition v128.0b4, Release v128.0 or ESR v115.13.0esr. This being considered, I cannot verify the fix on my main system.
System specs:
Windows 10
AMD Ryzen 7 2700X
16.0 GB
AMD RX580
I've managed to reproduce on a lower-end PC, but the reproduction was inconsistent on both affected and fixed builds. I do not know how timing could influence this behavior, but it can still be reproduced on fixed builds at quite the same rate as on the unaffected builds.
System specs:
Windows 10
AMD FX(tm)-8320 Eight-Core Processor
16.0 GB
NVIDIA GT710
Hi Hafiizh! Thank you for the testing in the try build! Could you please take a few minutes to test this fix in the following builds?
- Nightly130 https://archive.mozilla.org/pub/firefox/nightly/2024/07/2024-07-18-21-47-49-mozilla-central/firefox-130.0a1.en-US.win64.zip
- Beta129 https://archive.mozilla.org/pub/firefox/candidates/129.0b6-candidates/build1/win64/en-US/firefox-129.0b6.zip
- ESR128 https://archive.mozilla.org/pub/firefox/candidates/128.0esr-candidates/build2/win64/en-US/firefox-128.0esr.zip
In my testing, the issue would still inconsistently reproduce in fixed builds and unfixed builds. Thanks!
| Reporter | ||
Comment 26•1 year ago
|
||
i cannot reproduce in Nightly130 , Beta129 , ESR128
| Reporter | ||
Comment 27•1 year ago
|
||
| Reporter | ||
Comment 28•1 year ago
|
||
| Reporter | ||
Comment 29•1 year ago
|
||
Comment 30•1 year ago
|
||
Thank you very much for the confirmation testing done on your system, Hafiizh!
Based on the reporter's confirmation I will close this issue as verified.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 31•1 year ago
|
||
This is ready to be uplifted to ESR 115.
I need to investigate why QA can still reproduce, but the patch strictly makes things better so we should uplift it anyway.
| Assignee | ||
Updated•1 year ago
|
Comment 32•1 year ago
|
||
Comment on attachment 9410842 [details]
Bug 1903187, r=Gijs!
Approved for 115.14esr
Comment 33•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Comment 34•1 year ago
|
||
Hi again, Hafiizh! Would you be kind enough to verify the same fix in the final channel? Thank you for your contribution!
| Reporter | ||
Comment 35•1 year ago
|
||
i cannot reproduce poc in 115.14.0esr (64-bit)
| Assignee | ||
Updated•1 year ago
|
Comment 36•1 year ago
|
||
I am setting firefox-esr115 flag to verified. Thanks!
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 37•1 year ago
|
||
Comment 38•1 year ago
|
||
Updated•1 year ago
|
Updated•10 months ago
|
Description
•