Closed Bug 1832195 (CVE-2023-37204) Opened 2 years ago Closed 2 years ago

Select Option Dropdown able to Overlap Fullscreen Notification Toast

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

VERIFIED FIXED
116 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 115+ verified
firefox113 --- wontfix
firefox114 --- wontfix
firefox115 --- verified
firefox116 --- verified

People

(Reporter: sourc7, Assigned: m_kato)

References

(Regression)

Details

(4 keywords, Whiteboard: [reporter-external] [client-bounty-form] [verif?][adv-main115+])

Attachments

(7 files, 1 obsolete file)

Attached file testcase.html

When trigger requestFullscreen and slowdown code on select option element, the select option dropdown still appear even the browser goes into fullscreen.

Tested on:

  • Firefox Nightly 115.0a1 (2023-05-09) (64-bit) on KDE X11
  • Firefox Nightly 115.0a1 (2023-05-09) (64-bit) on KDE Wayland

Steps to reproduce:

  1. Visit attached testcase.html
  2. Click "AAAAAAAAAAAAAAAAAAAAAAA..." on select option element
  3. Select option dropdown overlap the fullscreen notification toast
Flags: sec-bounty?
Group: firefox-core-security → core-security
Component: Security → DOM: Core & HTML
Product: Firefox → Core
Group: core-security → dom-core-security

When running this on mozregression, I able to reproduce the select dropdown overlap after below pushlog:

13:49.60 INFO: Last good revision: 9c6c93f01c00b52b10e44257fca3fbdff9109e61
13:49.60 INFO: First bad revision: aa0f92939f44b845804b6d9ba69746d841c6bc49
13:49.60 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=9c6c93f01c00b52b10e44257fca3fbdff9109e61&tochange=aa0f92939f44b845804b6d9ba69746d841c6bc49

Assuming I am understanding you correctly, I'm going to mark this as a regression from bug 1744288, as that is related to full screen.

Regressed by: 1744288

Set release status flags based on info from the regressing bug 1744288

:m_kato, since you are the author of the regressor, bug 1744288, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

FWIW, I was unable to repro on Windows 11 or Ubuntu 22.04 (gnome wayland), mccr8 also tried MacOS (no repro). I don't have a KDE install to test with.

Irvan, could you reproduce on Ubuntu 22.04 GNOME?

Flags: needinfo?(m_kato) → needinfo?(susah.yak)

I guess that z-index is same as full screen UI and dropdown. I think that this might be timing issue and this might occurs even if not landing bug 1744288.

Assignee: nobody → m_kato

bug 1744288 changes that requestFullscreen dispatches DOMFullscreen:Request immediately. And select actor tries to open drop down list by mousedown. So select actor won't close drop down list by entering fullscreen.

I think that we use AsyncEventDispatcher instead to fix this.

(In reply to Makoto Kato [:m_kato] from comment #6)

Irvan, could you reproduce on Ubuntu 22.04 GNOME?

I able to reproduce this very reliably on KDE X11 and Wayland on 2 PC with different CPU and screen resolution. I also able to reproduce this on Firefox Nightly 115.0a1 (2023-05-10) (64-bit) on Windows 11 with full-screen-api.transition-duration.enter set to 0 0.

I'll (In reply to Makoto Kato [:m_kato] from comment #6)

Irvan, could you reproduce on Ubuntu 22.04 GNOME?

I haven't tried it on Ubuntu 22.04 GNOME, I'll try it soon.

Alright, by raising the JS slowdown code calculatePrimes(1000, 1000) to calculatePrimes(1000, 11011100) I also able to reproduce the fullscreen overlap with Firefox default configuration (without changing full-screen-api.transition-duration.enter) on Windows 11.

Flags: needinfo?(susah.yak)

Thanks, Irvan. I make sense this issue (root cause is comment #8)

Severity: -- → S2
Duplicate of this bug: CVE-2024-1548
Attached file new test case (obsolete) —

This occurs on 102a1 (20220516215740) too. Although I can reproduce reporter case after landing bug 1744288, I can reproduce my test case that is modified version of bug 1832627 on old version (102a1 (20220516215740)).

(In reply to Makoto Kato [:m_kato] from comment #17)

Created attachment 9333828 [details]
new test case

This occurs on 102a1 (20220516215740) too. Although I can reproduce reporter case after landing bug 1744288, I can reproduce my test case that is modified version of bug 1832627 on old version (102a1 (20220516215740)).

On my testcase after only single click the select dropdown able to cover the fullscreen toast, so victim unable to see the toast at all, which is more severe, reliable, and straightforward.

On the new testcase it require double click, at the first click the full-screen notification toast is immediately visible to victim, the victim has been notified and will be suspicious here, it is very unlikely to be used for real-life spoof scenario. Also when I tried double-clicking fast it not able to cover the fullscreen toast.

Normally double clicking the select dropdown is able to overlap the fullscreen toast, it possible from long time ago (able to reproduce on Firefox 59.0a1 (2018-01-01) (64-bit) and earlier Firefox version also do)

(In reply to Irvan Kurniawan (:sourc7) from comment #18)

(In reply to Makoto Kato [:m_kato] from comment #17)

Created attachment 9333828 [details]
new test case

This occurs on 102a1 (20220516215740) too. Although I can reproduce reporter case after landing bug 1744288, I can reproduce my test case that is modified version of bug 1832627 on old version (102a1 (20220516215740)).

On my testcase after only single click the select dropdown able to cover the fullscreen toast, so victim unable to see the toast at all, which is more severe, reliable, and straightforward.

Yes, but when showing full screen notification, I think we should show it on top most even if double click. I can fix our report issue, but I am looking for possible other case, and we need to consider more.

Emilio, is there a way to change fullscreen notification (by fullscreen-and-pointerlock.inc.xhtml) order to topmost at force? When showing XUL's menu item by <select> element during fullscreen notification is shown at same time, XUL menu is topmost, not full screen notification.

Flags: needinfo?(emilio)

When writing sample HTML, Chrome/Blink's fullscreen notification order isn't topmost. dropdown by <select> is topmost, not fullscreen notification.

Not easily, the select menu is a native os widget. You'd need to turn the pointer lock warning into a <panel> or something like that.

Flags: needinfo?(emilio)

This was filed within the collision window of its dupe and therefore eligible for a split bounty

Flags: sec-bounty? → sec-bounty+
No longer duplicate of this bug: CVE-2024-1548
Attachment #9337670 - Attachment description: WIP: Bug 1832195 - Don't fire full screen request immediately. → Bug 1832195 - Don't fire full screen request immediately.
Attachment #9333828 - Attachment is obsolete: true

Comment on attachment 9337670 [details]
Bug 1832195 - Don't fire full screen request immediately.

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: Not easy. This changes event timing only. I don't think that this issue is full screen related issue.
  • 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 older supported branches are affected by this flaw?: 111
  • If not all supported branches, which bug introduced the flaw?: Bug 1744288
  • Do you have backports for the affected branches?: Yes
  • If not, how different, hard to create, and risky will they be?: N/A
  • How likely is this patch to cause regressions; how much testing does it need?: Low. automation test will cover about new regression test
  • Is Android affected?: No
Attachment #9337670 - Flags: sec-approval?

Comment on attachment 9337670 [details]
Bug 1832195 - Don't fire full screen request immediately.

Approved to request uplift and land

Attachment #9337670 - Flags: sec-approval? → sec-approval+

:m_kato next week is RC week for Fx115, the last beta build is tomorrow.
Will this land and have an uplift request before then?

Flags: needinfo?(m_kato)

Comment on attachment 9337670 [details]
Bug 1832195 - Don't fire full screen request immediately.

Beta/Release Uplift Approval Request

  • User impact if declined: fullscreen notification is overlapped by dropdown box.
  • 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: Browse https://bugzilla.mozilla.org/attachment.cgi?id=9333117
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Low. back to previous event timing for fullscreen.
  • String changes made/needed: N/A
  • Is Android affected?: No
Flags: needinfo?(m_kato)
Attachment #9337670 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Landed: https://hg.mozilla.org/integration/autoland/rev/55d4f8fe0d124e37fc86bb6f141a120971df2157

Backed out for causing failures in browser_fullscreen_exit_on_external_protocol.js:
https://hg.mozilla.org/integration/autoland/rev/69b307c902da19e6d641ac54f0b0b8a5d32db4c4

Push with failures
Failure log

[task 2023-06-22T06:55:07.824Z] 06:55:07     INFO - TEST-START | dom/base/test/fullscreen/browser_fullscreen_exit_on_external_protocol.js
[task 2023-06-22T06:55:07.841Z] 06:55:07     INFO - Entering setup bound 
[task 2023-06-22T06:55:07.879Z] 06:55:07     INFO - Leaving setup bound 
[task 2023-06-22T06:55:07.880Z] 06:55:07     INFO - Entering test bound setupMailHandler
[task 2023-06-22T06:55:07.893Z] 06:55:07     INFO - Leaving test bound setupMailHandler
[task 2023-06-22T06:55:07.894Z] 06:55:07     INFO - Entering test bound OpenExternalProtocolOnPendingFullscreen
[task 2023-06-22T06:55:08.562Z] 06:55:08     INFO - GECKO(3895) | JavaScript error: , line 0: TypeError: Fullscreen request aborted

...

[task 2023-06-22T06:59:10.044Z] 06:59:10     INFO - TEST-UNEXPECTED-FAIL | dom/base/test/fullscreen/browser_fullscreen_exit_on_external_protocol.js | Test timed out - 
Flags: needinfo?(m_kato)

Due to previous fix, I need to update
browser_fullscreen_exit_on_external_protocol.js since internal fullscreen
event isn't dispatched before request is canceled.

Also, I add one more test for cancelling fullscreen during transition.

Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
Flags: needinfo?(m_kato)

Comment on attachment 9337670 [details]
Bug 1832195 - Don't fire full screen request immediately.

115 is now in RC, moving uplift request to release

Attachment #9337670 - Flags: approval-mozilla-beta? → approval-mozilla-release?
QA Whiteboard: [qa-triaged]

The patch landed in nightly and beta is affected.
:m_kato, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox115 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(m_kato)

Clearing ni - we will uplift this for Fx115.0 RC2

Flags: needinfo?(m_kato)

Reproduced the initial issue using an old Nightly build from 2023-05-09 and the testcase provided, verified that using latest Nightly from today (2023-05-27/28) this is no longer an issue, I can see the same behavior as in Firefox esr102, the fullscreen notification if visible when entering fullscreen mode across platforms (Windows 10, Ubuntu 22.04 and macOS 13.2).

Flags: qe-verify+

Comment on attachment 9337670 [details]
Bug 1832195 - Don't fire full screen request immediately.

Approved for 115.0 RC2

Attachment #9337670 - Flags: approval-mozilla-release? → approval-mozilla-release+

(In reply to Bogdan Maris, Desktop QA from comment #35)

Reproduced the initial issue using an old Nightly build from 2023-05-09 and the testcase provided, verified that using latest Nightly from today (2023-05-27/28) this is no longer an issue, I can see the same behavior as in Firefox esr102, the fullscreen notification if visible when entering fullscreen mode across platforms (Windows 10, Ubuntu 22.04 and macOS 13.2).

Also verified on Firefox 115.0-build2 and 115.0esr-build2 on the same platforms as above.

Status: RESOLVED → VERIFIED
Whiteboard: [reporter-external] [client-bounty-form] [verif?] → [reporter-external] [client-bounty-form] [verif?][adv-main115+][adv-esr102.13+]
Alias: CVE-2023-37204
Whiteboard: [reporter-external] [client-bounty-form] [verif?][adv-main115+][adv-esr102.13+] → [reporter-external] [client-bounty-form] [verif?][adv-main115+]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: