Closed Bug 2017666 (CVE-2026-4712) Opened 5 months ago Closed 5 months ago

incorrect private browsing status for native Cocoa windows

Categories

(Core :: Widget: Cocoa, defect)

defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 149+ fixed
firefox147 --- wontfix
firefox148 --- wontfix
firefox149 + fixed

People

(Reporter: jaas, Assigned: jaas)

References

(Regression)

Details

(5 keywords, Whiteboard: [adv-main149+][adv-ESR140.9+])

Attachments

(2 files)

48 bytes, text/x-phabricator-request
dveditz
: sec-approval+
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The last argument in the following function communicates whether the window is used for private browsing:

nsresult nsCocoaWindow::CreateNativeWindow(const NSRect& aRect,
                                           BorderStyle aBorderStyle,
                                           bool aRectIsFrameRect,
                                           bool aIsPrivateBrowsing)

This is how that is handled:

  // Make sure that window titles don't leak to disk in private browsing mode
  // due to macOS' resume feature.
  mWindow.restorable = !aIsPrivateBrowsing;
  if (aIsPrivateBrowsing) {
    [mWindow disableSnapshotRestoration];
  }

Note that mWindow.restorable is the inverse of private browsing. A window should not be restorable if it is for private browsing.

Now look at what happens in nsCocoaWindow::HideWindowChrome:

  // Recreate the window with the right border style.
  NSRect frameRect = mWindow.frame;
  BOOL restorable = mWindow.restorable;
  DestroyNativeWindow();
  nsresult rv = CreateNativeWindow(
      frameRect, aShouldHide ? BorderStyle::None : mBorderStyle, true,
      restorable);

This function is attempting to create a new native window based on the previous one. Unfortunately, the last argument it passes to communicate private browsing status is mWindow.restorable. This should be the inverse.

Private browsing windows become non-private, and non-private windows become private. This can leak information about private browsing windows to disk.

Attached file (secure)
Assignee: nobody → jaas
Status: NEW → ASSIGNED
Keywords: regression
Regressed by: 639707

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

Group: core-security → dom-core-security

Comment on attachment 9546164 [details]
(secure)

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: There is a potential of leaking private information to disk due to the fact that non-private browser windows are opened when a user expects them to be private.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: I have modified the commit message, but a careful and educated look at the patch could reveal the issue.
  • Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: All and yes.
  • 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?: Should apply cleanly, or can easily be adjusted.
  • How likely is this patch to cause regressions; how much testing does it need?: Highly unlikely.
  • Is the patch ready to land after security approval is given?: Yes
  • Is Android affected?: No
Attachment #9546164 - Flags: sec-approval?
Severity: -- → S2
Flags: sec-bounty?

Is the private browsing leakage limited to situations where native fullscreen is disabled (full-screen-api.macos-native-full-screen=false)?

(In reply to Haik Aftandilian [:haik] from comment #6)

Is the private browsing leakage limited to situations where native fullscreen is disabled (full-screen-api.macos-native-full-screen=false)?

I believe this is the case.

Comment on attachment 9546164 [details]
(secure)

sec-approval not required for sec-moderate or sec-low bugs

Attachment #9546164 - Flags: sec-approval? → sec-approval+
Group: dom-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
QA Whiteboard: [qa-triage-done-c150/b149]
QA Whiteboard: [qa-triage-done-c150/b149] → [sec] [qa-triage-done-c150/b149]

Please nominate this for ESR140 uplift when you get a chance.

Flags: needinfo?(jaas)
Attachment #9551908 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined: Window restore of private windows will be restored as normal (non-private) windows.
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Corrects a single boolean parameter.
  • String changes made/needed: None.
  • Is Android affected?: no
Attachment #9551908 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+

There is a request for info from me here but I'm not sure what input is needed. Are you asking my opinion about uplifting to ESR 140? If so, I think others are more qualified than me. I'm not sure what the standard criteria are.

Flags: needinfo?(jaas)
Whiteboard: [adv-main149+][adv-ESR140.9+]
Alias: CVE-2026-4712
Flags: sec-bounty? → sec-bounty+
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: