Closed Bug 2048699 (CVE-2026-84136) Opened 5 months ago Closed 3 months ago

SessionHistory IPC accepts non-sender-owned BrowsingContext and lets popup content drive opener/victim history traversal

Categories

(Core :: DOM: Navigation, defect)

Firefox 154
defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox-esr153 155+ fixed
firefox153 --- wontfix
firefox154 --- wontfix
firefox155 + fixed

People

(Reporter: mihebur, Assigned: farre)

Details

(4 keywords, Whiteboard: [adv-main155+][adv-esr153.2+])

Attachments

(6 files, 2 external files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36

Steps to reproduce:

I tested the Firefox SessionHistory IPC path with a PoC that models a compromised or confused content-side sender.

This report is related in class to bug 2047357 and bug 2048592, but affects a different consumer: SessionHistory / HistoryGo. I am filing it as a limited-impact IPC ownership/hardening issue in the same family, not as a claim of sandbox escape or direct cross-origin data access.

The PoC creates a victim/opener tab on mochi.test with two same-tab history entries, then opens an attacker popup on example.com. The PoC changes only the content-side sender path immediately before ContentChild::SendHistoryGo(...), retargeting HistoryGo(-1) from the popup's own BrowsingContext to the opener/victim BrowsingContext.

I ran:

MOZ_HEADLESS=1 ./mach test docshell/test/browser/browser_fip030_history_go_cross_bc_opener_probe.js

The attached markdown file contains the full technical writeup, patch, and runtime evidence.

Actual results:

The parent accepted the retargeted BrowsingContext and applied the history traversal to the opener/victim tab.

Key runtime evidence:

FIP030-SENDER retarget HistoryGo senderBC=17179869185 openerBC=15 offset=-1
FIP030 victim navigated after attacker history.back(): true
FAIL test_cross_bc_history_go_to_opener - A popup content process should not drive opener/victim session history traversal

The victim/opener tab navigated from victim2 back to victim1 after the attacker popup called history.back().

I am not claiming sandbox escape, memory corruption, direct cross-origin data read, or arbitrary script execution. The demonstrated issue is an IPC trust-boundary failure. The test sets browser.navigation.requireUserInteraction to false to isolate the ownership-validation issue; the default value is true, so practical reach is likely limited by existing history/user-interaction rules.

Expected results:

The parent-side SessionHistory IPC receiver should reject, ignore, or otherwise avoid applying HistoryGo to a BrowsingContext that is not owned by, or authorized for, the sending content process.

A popup/content sender should not be able to drive its opener/victim tab's session history traversal by retargeting HistoryGo IPC to the opener's BrowsingContext.

More generally, the family of parent-side receivers that accept MaybeDiscardedBrowsingContext from content should be audited to ensure they validate sender ownership before applying state changes, dispatching events, or routing browser/user actions.

In the PoC, the victim/opener tab should have remained on victim2.

This report refers to a test case file that does not exist. Please attach it to the bug report.

Flags: needinfo?(mihebur)
Group: firefox-core-security → dom-core-security
Component: Untriaged → DOM: Navigation
Product: Firefox → Core
Flags: needinfo?(mihebur)

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

This report refers to a test case file that does not exist. Please attach it to the bug report.

Sorry about that. The original attachment was the technical writeup, but I did not attach the standalone testcase patch.

I am attaching the patch containing the browser-chrome testcase:

docshell/test/browser/browser_fip030_history_go_cross_bc_opener_probe.js

The patch also contains the small content-side sender instrumentation used to model a compromised/confused sender retargeting HistoryGo to the opener BrowsingContext.

I also attached the clean test output. Key runtime lines:

FIP030-SENDER retarget HistoryGo senderBC=17179869185 openerBC=15 offset=-1
FIP030 victim navigated after attacker history.back(): true

I also tested the adjacent NavigationTraverse IPC path as a sibling variant of this issue.

ContentParent::RecvNavigationTraverse has the same sender-supplied MaybeDiscarded<BrowsingContext> shape: it resolves aContext.get_canonical() and calls canonical->NavigationTraverse(..., Some(ChildID()), ...) without an explicit check that the sender owns the supplied BrowsingContext.

I will attach the supporting artifacts separately:

  • fip064-navigationtraverse-crossbc.patch
  • fip064-navigationtraverse-parent-key-override.patch
  • fip064-navigationtraverse-parent-override-test.log

The probe retargets the popup content process' outgoing SendNavigationTraverse message to the opener/victim BrowsingContext, then supplies the victim's Navigation API key at the parent boundary.

Runtime result from fip064-navigationtraverse-parent-override-test.log:

FIP064-SENDER retarget NavigationTraverse senderBC=17179869185 openerBC=15
FIP064-PARENT override NavigationTraverse key=e4b05451-6049-4f1a-ac09-325f336daa73 child=9
FIP064 attacker traverseTo(local key) result after IPC retarget shim: completed
FIP064 victim navigated after attacker NavigationTraverse IPC retarget: true
FAIL ... A popup content process should not drive opener/victim NavigationTraverse

Scope note: the normal public Navigation API rejects a key that is not present in the popup's own entry list before IPC. This probe tests the parent-side IPC trust boundary, not unmodified page JavaScript directly calling navigation.traverseTo() with another tab's key.

This appears to be the same ownership-validation class as the original HistoryGo issue, exposed through RecvNavigationTraverse. It may be worth auditing other parent receivers that accept sender-supplied MaybeDiscarded<BrowsingContext> values.

The rating assigned by our bug rating tool (currently under development) is:

Rating: sec-low

Explanation: The report accurately describes the code: ContentParent::RecvHistoryGo and RecvNavigationTraverse (dom/ipc/ContentParent.cpp ~7542-7566) resolve a sender-supplied MaybeDiscarded<BrowsingContext> and call CanonicalBrowsingContext::HistoryGo / NavigationTraverse without verifying the sending content process owns that BrowsingContext. This is a genuine IPC ownership/trust-boundary (defense-in-depth) gap. However, the issue is NOT reachable from unmodified Firefox: the reporter explicitly patches the content-side sender (ContentChild::SendHistoryGo / SendNavigationTraverse) to retarget the message to the opener BC, i.e. it models a compromised/confused content process. Normal page JS cannot reach it (the public History/Navigation APIs only ever send the page's own BC and validate keys before IPC), and the PoC additionally flips the default pref browser.navigation.requireUserInteraction (true by default) to false. Even when triggered, the impact is strictly bounded: the attacker can only drive the victim/opener tab back/forward within entries already in its own session history. There is no memory corruption, no sandbox escape, no cross-origin data read, and no ability to navigate the victim to an arbitrary attacker URL. Given the clear security implication but very limited scope and the requirement of an already-compromised content process plus a non-default pref, sec-low is appropriate (this is essentially an IPC hardening issue); it is not memory-safety or data-disclosure and so does not rise to moderate/high. No screenshots/videos required review.

Keywords: sec-low
Assignee: nobody → afarre
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: -- → S3
Attached file (secure) —
Pushed by afarre@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/585374681248 https://hg.mozilla.org/integration/autoland/rev/e3a30f81c9ce Ensure the browsing context can do history traversal. r=dom-core-reviewers,smaug
Pushed by rperta@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2836eebd3722 https://hg.mozilla.org/integration/autoland/rev/99ea8a9722b6 Revert "Bug 2048699 - Ensure the browsing context can do history traversal. r=dom-core-reviewers,smaug" for causing mochitest failures at test_hashchange_popstate_event_order.html

Backed out for causing mochitest failures at test_hashchange_popstate_event_order.html
Backout link
Push with failures
Failure log(s) 1
Failure log(s) 2
and aslo this log and this dt failure

And also this - log

Flags: needinfo?(afarre)
Flags: needinfo?(afarre)

There is an r+ patch which didn't land and no activity in this bug for 1 week.
:farre, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(smaug)
Flags: needinfo?(afarre)
Flags: needinfo?(smaug)
Flags: needinfo?(afarre)
Pushed by afarre@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/3caac803f120 https://hg.mozilla.org/integration/autoland/rev/ad4cc0d4d263 Ensure the browsing context can do history traversal. r=dom-core-reviewers,smaug
Pushed by sstanca@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e1f10772429e https://hg.mozilla.org/integration/autoland/rev/11b9f062dfa9 Revert "Bug 2048699 - Ensure the browsing context can do history traversal. r=dom-core-reviewers,smaug" for causing wpt failures in navigate-destination-after-detach.html.

TEST-UNEXPECTED-FAIL | /navigation-api/navigation-history-entry/after-detach.html | navigation.currentEntry/entries()/canGoBack/canGoForward after iframe removal - promise_test: Unhandled rejection with value: object "InvalidStateError: No such entry with key found"

followed by more failures, see the log.

Flags: needinfo?(afarre)

(I think :farre is on PTO for a while, so adding a needinfo on :smaug to potentially take a look, but leaving :farre's needinfo in case someone is monitoring his needinfos.)

Flags: needinfo?(smaug)

This is sec-low. Can wait for afarre.

Flags: needinfo?(smaug)
Pushed by afarre@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cd138927aae9 https://hg.mozilla.org/integration/autoland/rev/67d10c3a9b59 Ensure the browsing context can do history traversal. r=dom-core-reviewers,smaug
Group: dom-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Flags: needinfo?(afarre)
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

Authored by https://github.com/farre
https://github.com/mozilla/enterprise-firefox/commit/cd138927aae91bf4e89e3ee676b496c4c1da2aaf
[enterprise-main] Bug 2048699 - Ensure the browsing context can do history traversal. r=dom-core-reviewers,smaug

Please request ESR153 uplift for this.

Flags: needinfo?(afarre)
QA Whiteboard: [sec] [qa-triage-done-c156/b155]

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Possible for compromised process to control global history navs.
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Performs an IPC filtering, following a common do nothing pattern.
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9627305 - Flags: approval-mozilla-esr153?
Attached file (secure) —
Flags: needinfo?(afarre)
Attachment #9627305 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
Whiteboard: [adv-main155+][adv-esr153.2+]
Alias: CVE-2026-84136
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: