Closed Bug 1887343 (CVE-2024-4776) Opened 8 months ago Closed 8 months ago

Window may remain disabled after file dialog is shown in full-screen

Categories

(Core :: Widget: Win32, defect)

Firefox 125
defect

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: Laraweron, Assigned: rkraesig)

Details

(Keywords: reporter-external, sec-low, Whiteboard: [adv-main126+])

Attachments

(4 files)

Attached file crash.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Steps to reproduce:

Open the attachment
Double-click the area
Select the image
Press ESC

The Firefox browser version 126.0a1 completely freezes and does not respond to commands.
Report: https://crash-stats.mozilla.org/report/index/4a5ad2e3-a855-42de-8227-fb7370240323#tab-details

In Firefox ESR, no crashes have been found, as the provided exploit does not pose a threat. For the Firefox Nightly version 125.0a1, the exploit appears more convincing.
I also confirm the crash in version 124 Stable.

Do you have the pref layers.gpu-process.crash-also-crashes-browser set to true? The stack suggests this is why it crashed, but it appears to be false by default. Crashing the GPU process is not great, but it isn't necessarily a security issue. Due to bad graphics drivers, the browser is expected to be able to deal with a crashing GPU process without the user noticing.

Flags: needinfo?(Laraweron)

The steps to reproduce didn't quite work for me as described on MacOS. I did a double click, which caused it to go full screen, but then I had to click again to make the file selector appear. I tried a random cat image I found online, and the image appeared without any issue. When you say "the issue", do you mean a specific image causes this problems or a specific one?

The test case looks very DOM-y, but the stack makes it look like the GPU process crashed, so maybe this is more graphics.

Group: firefox-core-security → core-security
Component: Untriaged → Graphics
Product: Firefox → Core
Group: core-security → gfx-core-security
Attached video Nightly 125.mp4

To reproduce the vulnerability, you need to press ESC, which causes a crash. I have added a video for clarification. I hid the error because the exploit itself can be reproduced in Firefox 125 to spoof the address bar.
https://drive.google.com/file/d/1RY8e1dKW8Ye5a5ouAS6gkztSEHqyRV3v/view?usp=sharing

Flags: needinfo?(Laraweron)

The graphics do not affect the crash; instead, something else breaks. It seems as though the file selection windows are not being unloaded and remain stuck in an invisible window. It is worth noting that the browser is unable to stop the process and unload the window on its own, and the only way to exit the browser is to forcefully terminate the process through the task manager. This behavior fits the description of a denial-of-service (DoS) attack.

Group: gfx-core-security → dom-core-security
Component: Graphics → DOM: Core & HTML
Summary: Crash @ mozilla::gfx::GPUProcessManager::OnProcessUnexpectedShutdown → File Selection window may become Invisible in fullscreen after pressing ESC

I still haven't been able to reproduce a crash, though I don't have that pref set so it might be crashing without me noticing.

Group: dom-core-security
Keywords: sec-low

I was able to reproduce this a few times but it is not 100% reliable. I had to close the browser from task manager when I triggered the issue.

Ray, could this be related to your Windows file picker work?

Flags: needinfo?(rkraesig)

(In reply to Andrew McCreight [:mccr8] from comment #8)

Ray, could this be related to your Windows file picker work?

Yes, almost certainly. What appears to be happening here — although I don't yet know how or why — is that the window is still WM_DISABLED after the file dialog is dismissed. Other Firefox windows, if there were any open, are unaffected. That shouldn't cause a crash, though... and I haven't been able to induce one either.

@Raphael, just to check that this isn't a language issue — are you referring to the state Firefox is in after pressing ESC, where you can't interact with it and have to kill it, as "crashed"? Or have you been able to make Firefox disappear without using Task Manager?

Flags: needinfo?(rkraesig) → needinfo?(Laraweron)

i mistakenly believed that the browser was malfunctioning, it seemed like a failure. The crash was caused when I closed the browser through the task manager.
So far, I've only been able to reproduce the problem in Windows, it appears that other operating systems are not affected. This issue allows attackers to control the browser, possibly showing advertisements that cannot be closed (auto-playing videos, new windows, or redirects to other websites).

Flags: needinfo?(Laraweron)
Assignee: nobody → rkraesig
Component: DOM: Core & HTML → Widget: Win32
Summary: File Selection window may become Invisible in fullscreen after pressing ESC → Window may remain disabled after file dialog is shown in full-screen
Status: UNCONFIRMED → NEW
Ever confirmed: true

When stripping and restoring window chrome, don't modify or retain any
flags other than window-chrome flags.

This also lets us remove a tiny bit of thirteen-year-old special-case
logic (dating back to bug 629860) which tried to fix up a different bit
of stale state.

Attachment #9393901 - Attachment description: Bug 1887343 - Only store window-chrome style-flags when going fullscreen r?#win-reviewers → Bug 1887343 - Store only window-chrome style-flags when going fullscreen r?#win-reviewers

It's worth documenting here that the issue was due to the fullscreen-entry logic saving, and then the fullscreen-exit logic restoring, the window-style flags on entry and exit into fullscreen mode. This unfortunately included WS_DISABLED, which it had no business fiddling with.

The solution is simply to cache and restore only those window-style flags which deal with window decorations that actually need to change when going fullscreen.

Pushed by rkraesig@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/29ce18e61ece Store only window-chrome style-flags when going fullscreen r=win-reviewers,handyman
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
QA Whiteboard: [qa-126b-p2]
Whiteboard: [adv-main126+]
Alias: CVE-2024-4776

Sorry for the burst of bugspam: filter on tinkling-glitter-filtrate
Adding reporter-external keyword to security bugs found by non-employees for accounting reasons

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: