Closed Bug 1963915 Opened 2 months ago Closed 1 month ago

Crash in [@ CheckAllowLoadByTriggeringRemoteType] when navigating a Firefox-Nightly-for-Android tab using remote devtools (about:debugging) URL bar

Categories

(DevTools :: about:debugging, defect, P2)

Unspecified
Android
defect

Tracking

(firefox-esr115 wontfix, firefox-esr128 wontfix, firefox138 wontfix, firefox139 wontfix, firefox140 fixed)

RESOLVED FIXED
140 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox138 --- wontfix
firefox139 --- wontfix
firefox140 --- fixed

People

(Reporter: dholbert, Assigned: ochameau)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

Crash report: https://crash-stats.mozilla.org/report/index/ffc3857f-c731-417d-b055-6aa2a0250501

MOZ_CRASH Reason:

Blocking load of about uri by content process which may have otherwise succeeded [aboutModule=config, isSystemPrincipal=1]

Top 10 frames:

0  libxul.so  MOZ_CrashSequence(void*, long)  mfbt/Assertions.h:253
0  libxul.so  MOZ_Crash(char const*, int, char const*)  mfbt/Assertions.h:381
0  libxul.so  CheckAllowLoadByTriggeringRemoteType(nsIChannel*)  dom/security/nsContentSecurityManager.cpp:1334
0  libxul.so  nsContentSecurityManager::doContentSecurityCheck(nsIChannel*, nsCOMPtr<nsIStr...  dom/security/nsContentSecurityManager.cpp:1414
1  libxul.so  nsJARChannel::AsyncOpen(nsIStreamListener*)  modules/libjar/nsJARChannel.cpp:1137
2  libxul.so  mozilla::net::DocumentLoadListener::Open(nsDocShellLoadState*, mozilla::net::...  netwerk/ipc/DocumentLoadListener.cpp:937
2  libxul.so  mozilla::MozPromise<bool, bool, false>::InvokeMethod<mozilla::net::DocumentLo...  xpcom/threads/MozPromise.h:652
2  libxul.so  mozilla::MozPromise<bool, bool, false>::InvokeCallbackMethod<false, mozilla::...  xpcom/threads/MozPromise.h:666
2  libxul.so  mozilla::MozPromise<bool, bool, false>::ThenValue<mozilla::net::DocumentLoadL...  xpcom/threads/MozPromise.h:923
3  libxul.so  mozilla::MozPromise<bool, bool, false>::ThenValueBase::ResolveOrRejectRunnabl...  xpcom/threads/MozPromise.h:488

STR:

  1. In Firefox Nightly on Android, open a tab at https://example.org/
  2. Inspect that tab using about:debugging (documentation here) from Firefox Nightly on a laptop/desktop.
  3. In the about:debugging devtools UI, focus the URL bar that's part of the devtools UI, and replace https://example.org/ with about:config and hit Enter

ACTUAL RESULTS: Firefox Nightly on Android crashes (bp-ffc3857f-c731-417d-b055-6aa2a0250501 in my case). This is a full app crash (i.e. "Process Type: parent"), not just a content-process crash.

EXPECTED RESULTS: No such crash.

(Note: We previously had bug 1838686 filed on this crash signature, which was closed several years back as "incomplete". I'm linking that up via see-also; I don't know if what I'm seeing now is the same as what we were seeing there.)

Adding dependency on bug 1538028 where this assertion was added.

Also: if I repeat the STR but I type in file:/// instead of about:config, then I get a content-process crash (i.e. just the one tab crashes), and the crash signature is a bit different: bp-a0f606b5-9cb1-4cee-9a5c-05cf70250501 [@ nsDocShellLoadState::AssertProcessCouldTriggerLoadIfSystem ], with MOZ_CRASH Reason MOZ_CRASH(Unexpected system load of file URI from web content process).

I'm adding that as an additional signature here since it seems like the same basic issue, just manifesting in a slightly different way.

(I think both assertions are warning us that we shouldn't be reusing the same process for this navigation; this might be a sign that the about:debugging DevTools are navigating in the wrong way here?)

Crash Signature: [@ CheckAllowLoadByTriggeringRemoteType] → [@ CheckAllowLoadByTriggeringRemoteType] [@ nsDocShellLoadState::AssertProcessCouldTriggerLoadIfSystem]

(In reply to Daniel Holbert [:dholbert] from comment #1)

Adding dependency on bug 1538028 where this assertion was added.

er, actually adding that dependency now. :) Also adding bug 1838686 as a dependency since that's where we added the code that's intentionally crashing for the file:/// URI variant that I described later in comment 1 (ah right, that's the bug that was originally tracking the main siganture here).

Depends on: CVE-2023-23597, 1838686

ni=nika who might be interested to look, since she was investigating this previously in bug 1838686.

Flags: needinfo?(nika)
Summary: Crash in [@ CheckAllowLoadByTriggeringRemoteType] when navigating using DevTools on Android → Crash in [@ CheckAllowLoadByTriggeringRemoteType] when navigating a Firefox-Nightly-for-Android tab using remote devtools (about:debugging) URL bar

It seems like perhaps the devtools UI for controlling the browser on mobile is starting navigations from the devtools url bar from a content process, instead of starting that navigation directly in the parent process. Doing something like that would trigger a crash like this one, as we don't want to trust the content process to perform navigations like this.

We should update the control interface using about:debugging to start the navigation directly from the parent process, rather than via the content process, so that the UI can be used to navigate to non-web-safe URIs (and perhaps add some tests for this).

Component: DOM: Navigation → about:debugging
Flags: needinfo?(nika)
Product: Core → DevTools

The component for this UI is at https://searchfox.org/mozilla-central/source/devtools/client/framework/components/DebugTargetInfo.js#23 and we hit the target actor (content process if page is in content) for navigating to a URL, going forward or backward.

The only exception is for the "reload" actions, which uses the target descriptor (parent process).

One option is to just reuse this pattern for the other navigation actions.

(also checked, and this component is the only one using target's goBack, goForward and navigateTo helpers, so we shouldn't have the same issue in other parts of the UI)

Severity: -- → S3
Priority: -- → P2
Depends on: 1937738
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/de11fb15a214 [devtools] Navigate back and forward from the parent process. r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Regressions: 1966826
QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: