mixed content blocker bypass: insecure sub-resources loaded by a localhost frame in a secure parent document
Categories
(Core :: DOM: Security, defect, P3)
Tracking
()
People
(Reporter: xiaoyin.l, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: sec-low, Whiteboard: [domsecurity-backlog1])
Attachments
(1 file, 2 obsolete files)
714 bytes,
application/x-zip-compressed
|
Details |
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Reporter | ||
Comment 5•4 years ago
|
||
Thank you for fixing this issue. Will this bug get a CVE assigned?
Comment 6•4 years ago
•
|
||
Backed out for causing android geckoview failures. CLOSED TREE
Backout link : https://hg.mozilla.org/integration/autoland/rev/8077dd2baa24b2e0d9609c03e24807ee64a5d2b0
Link to failure log :
https://treeherder.mozilla.org/logviewer?job_id=356970217&repo=autoland&lineNumber=2942
https://treeherder.mozilla.org/logviewer?job_id=356970145&repo=autoland&lineNumber=9049
https://treeherder.mozilla.org/logviewer?job_id=356972890&repo=autoland&lineNumber=45198
https://treeherder.mozilla.org/logviewer?job_id=356979025&repo=autoland&lineNumber=1342
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 7•3 years ago
|
||
Hey Tom, this has an r+ patch (including a test) but was backed out - is that something you feel like pushing over the finishing line?
Comment 8•3 years ago
|
||
Sure, I guess I will see what try turns up.
Comment 9•3 years ago
|
||
It seems like the Geckoview problems are still there: https://treeherder.mozilla.org/jobs?repo=try&revision=fba594428ecfc840fbf02ab433f050e328618167
Updated•3 years ago
|
Comment 10•3 years ago
|
||
So I haven't really had much luck with working on GeckoView before, so I am trying to debug this a bit by looking at the logs and reading the tests. Hopefully someone from the GeckoView team can help me out with this.
For example:
org.mozilla.geckoview.test.OpenWindowTest#openWindowNullDelegate | org.mozilla.geckoview.test.util.UiThreadUtils$TimeoutException
This test seems to load some kind of page OPEN_WINDOW_PATH
. If I am following the code correctly this ends up as a http:// URL because TEST_ENDPOINT uses http://. Furthermore this test uses Notification.requestPermission(), which I think shouldn't be possible in a non-secure context anyway.
Agi would you mind having a look at this?
Comment 11•3 years ago
|
||
If you want those tests to use https
I think the easiest way would be to add the test file to https://searchfox.org/mozilla-central/rev/301e9545863b14ff85aa110fabd4274da4593f9d/mobile/android/moz.build#74 and then load it using https://example.org/tests/junit/<filename>
: https://searchfox.org/mozilla-central/rev/301e9545863b14ff85aa110fabd4274da4593f9d/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/NavigationDelegateTest.kt#717
Comment 12•3 years ago
|
||
Depends on D120622
Comment 13•3 years ago
|
||
I just came back to this, thanks Agi for your hints. Sadly I haven't fully gotten this to work yet. I have to suspicion that the emulator isn't loading the test that I want it to load.
I still see the following warning even after adding the doctype:
[JavaScript Warning: "This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”." {file: "https://example.org/tests/junit/worker/open_window.html" line: 0}]
The console.log calls don't show up either.
Comment 14•3 years ago
|
||
So, it turns out it was indeed loading a 404 page and not open_window.html
. The root cause seems to be that when hosted the sub-directory gets flattened and worker/
is removed.
Comment 15•3 years ago
|
||
So I think we need to change the logic in the original patch somehow, because we don't allow loading workers from http://localhost even when on that domain anymore. localhost
is a secure-context so we don't early return after the patch. I think fixing this would also resolve the android failures.
Updated•3 years ago
|
Comment 16•3 years ago
|
||
So there is one remaining failure in org.mozilla.geckoview.test.WebExtensionTest#redirectToExtensionResource
that points to a behavior change that I am not sure what we want to do about.
(Simplified) http://localhost/foo.bar is a secure context, because localhost is considered such, and loads an other http://example.org/script.js. Previously this was obviously not mixed content because both use https. But now one is a "secure context" and the other uses "https". I think to fix the original issue we would need to break this, or know when "inheriting" https from a parent frame.
Updated•3 years ago
|
Comment 17•3 years ago
|
||
My understanding is that we need to walk the frame tree and not check the protocol but rather always check the isSecureContext
bit. (Sorry for the overly long wait)
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Description
•