Closed Bug 1740389 (CVE-2022-22741) Opened 3 years ago Closed 3 years ago

Browser window is locked in fullscreen mode using window.resizeBy() or resizeTo()

Categories

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

Unspecified
Windows
task

Tracking

()

VERIFIED FIXED
97 Branch
Tracking Status
firefox-esr91 96+ verified
firefox95 --- wontfix
firefox96 + verified
firefox97 + verified

People

(Reporter: sourc7, Assigned: edgar)

References

Details

(Keywords: csectype-dos, csectype-spoof, sec-high, Whiteboard: [reporter-external] [client-bounty-form][adv-main96+][adv-ESR91.5+][sec-survey])

Attachments

(5 files)

After invoke requestFullScreen in the popup window then move the popup window using moveBy or moveTo the browser goes into full screen with hidden fullscreen notification and moreover fullscreen mode won't exit even repeatedly press "esc" multiple times.

Tested on:

  • Firefox Nightly 96.0a1 (2021-11-09) on Windows 11
  • Firefox Release 94.0.1 on Windows 10 and Windows 11

Steps to reproduce:

  1. Visit attached launcher-fullscreen.bundle.html
  2. Click "Launch" button
  3. Tap anywhere on the popup page
  4. Browser goes into fullscreen with hidden fullscreen notification
  5. Press "esc" multiple times to try exit the fullscreen mode
  6. Browser still persist in fullscreen mode
Flags: sec-bounty?
Summary: Hide Fullscreen Notification then Lock Fullscreen Mode using Window moveBy() or moveTo() → Hide Fullscreen Notification and Lock Fullscreen Mode using Window moveBy() or moveTo()
Summary: Hide Fullscreen Notification and Lock Fullscreen Mode using Window moveBy() or moveTo() → Hide Fullscreen Notification and Lock Fullscreen Mode using Window resizeBy() or resizeTo()

Oh sorry typo, it should be resizeBy or resizeTo as on attached testcase.

Seems to not work on macOS or linux, fwiw. Confirmed by Tyson on Windows.

It is possible to "get out" by Alt-tab to the original non-popup browser window, but the fullscreen persists if you switch back to the popup.

Group: firefox-core-security → core-security
Component: Security → DOM: Core & HTML
Flags: needinfo?(echen)
Product: Firefox → Core
Group: core-security → dom-core-security

(In reply to Daniel Veditz [:dveditz] from comment #3)

Seems to not work on macOS or linux, fwiw. Confirmed by Tyson on Windows.

Thanks Dan for the update, it turns out after removing document.write from the launcher-fullscreen.bundle.html, then testing this on Arch Linux and Ubuntu the fullscreen notification will also hidden, but press "esc" will exit the fullscreen mode.

It is possible to "get out" by Alt-tab to the original non-popup browser window, but the fullscreen persists if you switch back to the popup.

Yes, it only block the "esc" key which related to fullscreen code, other keyboard shortcut e.g. "ctrl+w" still works.

Edgar said he is investigating.

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

It is possible to "get out" by Alt-tab to the original non-popup browser window, but the fullscreen persists if you switch back to the popup.

Yes, it only block the "esc" key which related to fullscreen code, other keyboard shortcut e.g. "ctrl+w" still works.

This is a windows only bug, after calling window.resizeBy(), it seems window widget lose tracking of fullscreen state, so we early return in https://searchfox.org/mozilla-central/rev/702199bca53babc925e47fd8f86ed56487d42492/widget/windows/nsWindow.cpp#3655 when we tries to exit fullscreen trigger from "esc" key.

Assignee: nobody → echen
Flags: needinfo?(echen)

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

(In reply to Daniel Veditz [:dveditz] from comment #3)

Seems to not work on macOS or linux, fwiw. Confirmed by Tyson on Windows.

Thanks Dan for the update, it turns out after removing document.write from the launcher-fullscreen.bundle.html, then testing this on Arch Linux and Ubuntu the fullscreen notification will also hidden, but press "esc" will exit the fullscreen mode.

This is another bug I think, it seems the warning is offset outside the viewport due to the window resize.
Chrome and safari exits fullscreen after window resize call, I think we should also follow them which is also good for compatibility.

(In reply to Edgar Chen [:edgar] from comment #7)

This is another bug I think, it seems the warning is offset outside the viewport due to the window resize.
Chrome and safari exits fullscreen after window resize call, I think we should also follow them which is also good for compatibility.

Split this out to bug 1742421.

Attached file Bug 1740389;
Summary: Hide Fullscreen Notification and Lock Fullscreen Mode using Window resizeBy() or resizeTo() → Browser window is locked in fullscreen mode using window.resizeBy() or resizeTo()
OS: Unspecified → Windows

Comment on attachment 9252103 [details]
Bug 1740389;

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: Probably not so hard, patch shows the issue is something with size mode and fullscreen exit, but someone would need to find a way to change the size mode.
  • 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?: All
  • 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?: None.
  • How likely is this patch to cause regressions; how much testing does it need?: My sense is it's unlikely. The patch is reasonable and only affect the exit fullscreen call. The existing fullscreen automatic test + the test case attached in the bug might be enough.
Attachment #9252103 - Flags: sec-approval?

Comment on attachment 9252103 [details]
Bug 1740389;

Approved to land and uplift

Attachment #9252103 - Flags: sec-approval?
Attachment #9252103 - Flags: sec-approval+
Attachment #9252103 - Flags: approval-mozilla-esr91+
Attachment #9252103 - Flags: approval-mozilla-beta+
Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

As part of a security bug pattern analysis, we are requesting your help with a high level analysis of this bug. It is our hope to develop static analysis (or potentially runtime/dynamic analysis) in the future to identify classes of bugs.

Please visit this google form to reply.

Flags: needinfo?(echen)
Whiteboard: [reporter-external] [client-bounty-form] [verif?] → [reporter-external] [client-bounty-form] [verif?][sec-survey]
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #13)

As part of a security bug pattern analysis, we are requesting your help with a high level analysis of this bug. It is our hope to develop static analysis (or potentially runtime/dynamic analysis) in the future to identify classes of bugs.

Please visit this google form to reply.

Done.

Flags: needinfo?(echen)

Reproduced the bug with STR from comment 0, on an affected Nightly build 95.0a1 (20211022213234).

The issue is verified as fixed on the latest builds: Nightly 97.0a1, Beta 96.0b4 and 91.5.0esr. Tested with Win 10 x64.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Flags: sec-bounty? → sec-bounty+
Whiteboard: [reporter-external] [client-bounty-form] [verif?][sec-survey] → [reporter-external] [client-bounty-form][adv-main96+][adv-ESR91.5+][sec-survey]
Attached file advisory.txt
Alias: CVE-2022-22741
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: