Reject javascript: requests targeting other content processes
Categories
(Core :: DOM: Content Processes, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: cpeterson, Assigned: kmag)
References
(Blocks 1 open bug)
Details
(Whiteboard: [ETA: waiting for Phabricator review])
Attachments
(1 file, 2 obsolete files)
Ensure javascript: requests targeting other content processes are rejected and add a test to verify this.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Nika and Peter said we should write a test that loading javascript URIs in an OOP iframe throws a nice exception in the console to ensure we don't regress it with Fission. Currently, without Fission, it fails silently.
Comment 3•4 years ago
•
|
||
A few notes from #Fission (thanks, kmag and nika!) :
Cross-process case:
- A
ContentChild
issuesjavascript:
load by callingBrowsingContext::LoadURI
– for our example, a (forbidden) cross-process load; - ... or
nsDocShell::LoadURI
(orInternalLoad
) sendsLoadURI
(orInternalLoad
) to theContentParent
; - The
BrowsingContext
sendsLoadURI
(orInternalLoad
) to theContentParent
(we need to block this with a nice error message). - The
ContentParent
receives theLoadURI
and sends aLoadURI
to another child (need to block this withIPC_FAIL
inContentParent::RecvLoadURI
-RecvInternalLoad
, in case theContentChild
has been compromised). - The
ContentChild
receives theLoadURI
(nothing to do, with the patch, this has already been blocked in step 3. or 4.).
In-process case:
Some same-process loads may hit nsDocShell::LoadURI
directly without going through BrowsingContext
, and they should still reject with a sane error if the triggering principal doesn't subsume the principal of the target document.
Also:
@kmag "Incidentally, you probably want to report the error with rv.ThrowSecurityError(...) something like this: https://searchfox.org/mozilla-central/rev/ce21a13035623c1d349980057d09000e70669802/js/xpconnect/wrappers/AccessCheck.cpp#153
But in the case of window.open and window.location = ..., I don't think we're allowed to throw for things like this, so I think we'll just need to create the exception and report it."
Left a few questions in https://phabricator.services.mozilla.com/D89361.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
More questions in https://phabricator.services.mozilla.com/D89361.
Assignee | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
I won't have time to finish this.
Updated•4 years ago
|
Reporter | ||
Comment 10•4 years ago
|
||
kmag just needs to rewrite the tests in Yoric's patch.
Keeping in Fission M6c.
Assignee | ||
Comment 11•4 years ago
|
||
Loads targeting cross-process BrowsingContexts are by definition cross-origin,
which should preclude any javascript: loads. While those loads are currently
prevented by principal checks in the final target process, sending IPC
messages for the attempts is unnecessary, and potentially opens a door to
privilege escalation exploits by a compromised content process.
This patch prevents any cross-process load requests from being sent by content
processes, and adds checks in the parent process to kill any (potentially
compromised) content process which attempts to send them.
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
Backed out changeset 0395717ea76d (bug 1647519) for build bustages at BrowsingContext.cpp.
https://hg.mozilla.org/integration/autoland/rev/13b11cf948be1c854403a2c8a53794d201d82e52
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&revision=0395717ea76def6574e2dd06fcbfbd19c0d298d5&selectedTaskRun=DOzYT8Y4SQyQDvwt4ys5wg.0
Failure log:
https://treeherder.mozilla.org/logviewer?job_id=328608947&repo=autoland&lineNumber=13419
Assignee | ||
Updated•4 years ago
|
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Backed out changeset c0ecccf36d56 (Bug 1647519) for causing bustages in BrowsingContext.cpp
Failure log: https://treeherder.mozilla.org/logviewer?job_id=328614054&repo=autoland&lineNumber=7567
Comment 16•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 17•4 years ago
|
||
Backed out changeset e4cefba9f87e (Bug 1647519) for build bustages in BrowsingContext.cpp.
https://hg.mozilla.org/integration/autoland/rev/11f295953afb1fa4783f7ef2a2f7bab04ac6c6ce
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&revision=e4cefba9f87ed7d4c5e49ae1b0a83875229d3667&selectedTaskRun=HLBUnTF1Rq6sM_bdq3MAuw.0
Failure log:
https://treeherder.mozilla.org/logviewer?job_id=328625001&repo=autoland&lineNumber=13562
Comment 18•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 19•4 years ago
|
||
bugherder |
Description
•