Fenix did not implement "enablement delay" on permission prompts or other dangerous UI that overlay the content area (Tapjacking Permission Using Fullscreen on Android)
Categories
(Firefox for Android :: Browser Engine, defect, P2)
Tracking
()
People
(Reporter: fazim.pentester, Assigned: amejia)
References
Details
(Keywords: csectype-clickjacking, reporter-external, sec-high, Whiteboard: [client-bounty-form] [geckoview:m118] [fxdroid] [group2][adv-main128+])
Attachments
(11 files)
1.75 KB,
text/html
|
Details | |
909.76 KB,
video/mp4
|
Details | |
1.70 KB,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
dveditz
:
sec-approval+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
2.24 MB,
video/mp4
|
Details | |
185 bytes,
text/plain
|
Details | |
1.70 KB,
text/html
|
Details | |
571.28 KB,
video/mp4
|
Details | |
2.01 MB,
video/mp4
|
Details |
Usually, Firefox requires two clicks to grant access when the Permission Dialogue is spoofed. However, on Android Firefox, this implementation is not present because the Permission Dialogue typically doesn't work with new tabs or pop-ups. However, by using an engaging game in Fullscreen mode, an attacker could Clickjack the victim into unknowingly allowing permissions such as Camera, Audio, or Location, etc.
Steps to Reproduce:
- Download the file poc.html to a folder.
- Host the file on an HTTPS site.
Open the Firefox browser on your Android device and navigate to the site at https://{YOUR-SITE}/poc.html to begin testing.
Reporter | ||
Comment 1•2 years ago
|
||
Video Demonstration: https://youtu.be/gdS7KWKUen4 (YouTube Unlisted)
Updated•2 years ago
|
Reporter | ||
Comment 2•2 years ago
|
||
Similar issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1826116
Reporter | ||
Comment 3•2 years ago
|
||
A different solution would be to introduce a delay between taps on the DOM and the allow button. Here's how the Chrome permission dialogue works to prevent tapjacking:
Reporter | ||
Comment 4•2 years ago
|
||
Reporter | ||
Comment 5•2 years ago
|
||
You can modify the CSS values of top and left within the #redBox to adjust the coordinates to align with the Permission buttons.
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 6•2 years ago
|
||
I believe bug 1836921 and 1836939 will be fixed by this one since they all use the same dialog class
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 7•2 years ago
|
||
(In reply to Shaheen Fazim from comment #3)
A different solution would be to introduce a delay between taps on the DOM and the allow button. Here's how the Chrome permission dialogue works to prevent tapjacking:
Yes, that's what is supposed to happen, and what the Desktop client and the old "Fennec" android client did. See bug 162020
Comment 8•2 years ago
|
||
Updated the summary to reflect the core problem so we're not overly distracted by the specific example demonstrated in this POC.
Reporter | ||
Comment 9•2 years ago
|
||
Thanks, I hope this gets fixed for the next release.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Comment hidden (obsolete) |
Updated•2 years ago
|
Comment 11•2 years ago
|
||
The severity field for this bug is set to S3. However, the bug is flagged with the sec-high
keyword.
:jonalmeida, could you consider increasing the severity of this security bug?
For more information, please visit BugBot documentation.
Updated•2 years ago
|
Comment hidden (duplicate) |
Comment 14•1 years ago
|
||
This bug has been stale for a long while. Was this intentionally not included in your security triage, bclark?
Comment hidden (duplicate) |
Reporter | ||
Comment 16•1 year ago
|
||
Hi, it's been a long time. Can we update on this issue?
Comment hidden (duplicate) |
Reporter | ||
Comment 18•1 year ago
|
||
Hi boek (Triage Owner),
Could you please provide an update on this bug? It's been sitting here without an update for a very long time, and it's a security issue.
Updated•1 year ago
|
Comment 19•1 year ago
•
|
||
Hi Shaheen, we do our best to fix all the bugs in Firefox. Unfortunately, there is only so much bandwidth we have. Thank you for your patience. If you have a question about the bounty for this bug, feel free to email security@mozilla.org
Comment 20•1 year ago
|
||
Clearing priority and severity to re-triage
Updated•1 year ago
|
Updated•1 year ago
|
Comment 21•1 year ago
|
||
Arturo, the Android security triage is assigning this sec-high bug to squad 2. This issue blocks tapjacking meta bug 1842064.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 22•1 year ago
|
||
Checking the desktop implementation to get more context and see what will be the approach in Android.
Assignee | ||
Comment 23•1 year ago
•
|
||
Adding @pbz as he was addressing similar issues on Desktop.
I wonder if instead of adding a possible solution to the Android layer (UI or GV), we have an unified solution on the Gecko layer (No to the UI), so all platforms will benefit from it and we have a consistent behaviour (Eventually we are going to have GV on iOS).
Is this is something possible @pbz? Or should I just create a similar solution on Android? Maybe we could delay the sending the message for a prompt in the Gecko layer?
Thanks in advance!
Assignee | ||
Comment 24•1 year ago
|
||
I guest the best security approach is to have logic directly on the UI, as it's suggested here
Comment 25•1 year ago
|
||
Agreed, I think this belongs into the UI code. See if the behavior we have on desktop works well for touch, if not you might have to adapt it.
Assignee | ||
Comment 26•1 year ago
|
||
Assignee | ||
Comment 27•1 year ago
|
||
Depends on D214307
Assignee | ||
Comment 28•1 year ago
|
||
Comment on attachment 9408500 [details]
Bug 1836786 - Improve prompts
Security Approval Request
- How easily could an exploit be constructed based on the patch?: Not that easy, changes have been separated to make it less obvious
- Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
- Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: beta, and release
- If not all supported branches, which bug introduced the flaw?: None
- Do you have backports for the affected branches?: Yes
- If not, how different, hard to create, and risky will they be?:
- How likely is this patch to cause regressions; how much testing does it need?: Low provability
- Is the patch ready to land after security approval is given?: Yes
- Is Android affected?: Yes
Assignee | ||
Comment 29•1 year ago
|
||
Patches have been approved!
We are just waiting on the sec-approval
.
Thanks in advance!
Comment 30•1 year ago
|
||
From the phabricator discussion: the refactoring of PromptAbuserDetector
was split out of this bug and into bug 1903828. This bug now "depends on" that one.
We don't like to check in tests that reveal the security bug until a release cycle or so after the patch ships (mid-August in this case assuming the fix it is Firefox 128 shipping July 9). Will you have to fix existing tests when this bug or bug 1903828 lands? Or is all of the changes in this test patch just to test this bug? I would guess that if you have to fix up any tests that should be bundled into the patch for bug 1903828 so that doesn't get backed out.
Comment 31•1 year ago
|
||
Comment on attachment 9408500 [details]
Bug 1836786 - Improve prompts
sec-approval+ = dveditz. Please request uplift to the beta branch after a few nightlies of testing to make sure the patch works. (we'll also have to request beta uplift of bug 1903828)
Assignee | ||
Comment 32•1 year ago
•
|
||
Will you have to fix existing tests when this bug or bug 1903828 lands? Or is all of the changes in this test patch just to test this bug?
As we just move PromptAbuserDetector
to another package previous tests are still working, not need to fix up.
For Bug 1836786 - Improve prompts we are planing to land D214311 after the bug is addressed and safe to disclose tests.
Comment 33•1 year ago
|
||
Comment 34•1 year ago
|
||
Assignee | ||
Comment 35•1 year ago
•
|
||
(In reply to Daniel Veditz [:dveditz] from comment #30)
From the phabricator discussion: the refactoring of
PromptAbuserDetector
was split out of this bug and into bug 1903828. This bug now "depends on" that one.We don't like to check in tests that reveal the security bug until a release cycle or so after the patch ships (mid-August in this case assuming the fix it is Firefox 128 shipping July 9). Will you have to fix existing tests when this bug or bug 1903828 lands? Or is all of the changes in this test patch just to test this bug? I would guess that if you have to fix up any tests that should be bundled into the patch for bug 1903828 so that doesn't get backed out.
There were a couple of UI tests that needs to be addressed, for the moment I just disabled them as in Bug #1903828, as fixing them will reveal exploit. I'll try to re-enable them on D214311.
Try to land again.
Comment 36•1 year ago
|
||
Comment 37•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Comment 38•1 year ago
|
||
The patch landed in nightly and beta is affected.
:amejia, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox128
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 39•1 year ago
|
||
Waiting for QA verification before uplifting.
Comment 40•1 year ago
•
|
||
(In reply to Arturo Mejia [:amejia] from comment #39)
Waiting for QA verification before uplifting.
:amejia fyi the last beta uplifts for the Fx129 cycle are tomorrow, so I will need an uplift request by tomorrow since this is a sec-high bug.
Assignee | ||
Comment 41•1 year ago
|
||
Filed the request via Lando, the revision is been issued https://phabricator.services.mozilla.com/D214975 but hasn't been linked to this bug.
Assignee | ||
Comment 42•1 year ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D214307
Updated•1 year ago
|
Comment 43•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: Users will continue be exposed to the exploit
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: See comment https://bugzilla.mozilla.org/show_bug.cgi?id=1836786#c0
- Risk associated with taking this patch: Low
- Explanation of risk level: We are just using a component that was already created before for other prompts
- String changes made/needed: No
- Is Android affected?: yes
Comment 44•1 year ago
|
||
beta Uplift Approval Request
- User impact if declined: Users will continue be exposed to the exploit
- Code covered by automated testing: no
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: See comment https://bugzilla.mozilla.org/show_bug.cgi?id=1836786#c0
- Risk associated with taking this patch: Low
- Explanation of risk level: We are just using a component that was already created before for other prompts
- String changes made/needed: No
- Is Android affected?: yes
Updated•1 year ago
|
Updated•1 year ago
|
Comment 45•1 year ago
|
||
uplift |
Updated•1 year ago
|
Reporter | ||
Comment 46•1 year ago
|
||
Thank you for the fix and bounty.
Comment 47•1 year ago
|
||
Hi, Arturo,
Apologies for not working on this sooner, but as this ticket was flagged as a security issue, it wasn't included in out "qe-verify+" list.
Could you clarify what's the expected result after tapping the "Click to play" button on the poc.html page?
I've tested this on the latest Nightly 129.0a1 07/08, Beta 128.0b9 and RC 128.0 build 2 with Xiaomi Redmi Note 8T (Android 11) and I've noticed 2 behaviors:
-
- after entering the full screen mode, the permission dialogue is not displayed after tapping the red button for 6+ times.
-
- after entering the full screen mode, the permission dialogue was displayed after tapping the red button for 6+ times, and the user can interact with it.
Additionally, with a high end device, Samsung Galaxy A53 5G (Android 14), the red button was not displayed at all after entering the full screen mode.
- after entering the full screen mode, the permission dialogue was displayed after tapping the red button for 6+ times, and the user can interact with it.
Reporter | ||
Comment 48•1 year ago
|
||
Odd. The permission prompt should appear after the click. Is it blocked for this site? If so, you should clear all permissions for the site to start fresh. I'm not sure if new changes have been introduced to block permissions in fullscreen.
Note: It would also work without fullscreen when the address bar is set on top instead of the default bottom in Firefox. If needed, I could make a better proof of concept for this, testing without the fullscreen API.
Updated•1 year ago
|
Comment 49•1 year ago
|
||
Updated•1 year ago
|
Reporter | ||
Comment 50•1 year ago
|
||
Hi Delia, I just made a new testcase ( test.html ). Can you test this again and see if it is working? Thank you.
Reporter | ||
Comment 51•1 year ago
|
||
Testing after the fix on version 128.
Comment 52•1 year ago
|
||
Thank you, Fazim, for providing the test page and the video recording, that helped a lot!
I managed to reproduce your behavior using the test.html: indeed, the permission dialogue is displayed shortly after interacting with the red button, and there's a significant delay between taps on the button and the taps on the allow button, preventing the user to allow access.
I'll update this ticket as verified.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 53•1 year ago
|
||
a month ago, dveditz placed a reminder on the bug using the whiteboard tag [reminder-test 2024-08-20]
.
amejia, please refer to the original comment to better understand the reason for the reminder.
Assignee | ||
Comment 54•1 year ago
|
||
Rebased tests patch and getting ready to land them
Comment 55•1 year ago
|
||
![]() |
||
Comment 56•1 year ago
|
||
Updated•6 months ago
|
Description
•