Commit Graph

1676 Commits

Author SHA1 Message Date
Razvan Maries
a985167fa6 Backed out 7 changesets (bug 1638711) for perma failures on test_bug375314-2.html. CLOSED TREE
Backed out changeset 9643bf18ac31 (bug 1638711)
Backed out changeset 3d06b48e2e3a (bug 1638711)
Backed out changeset c2a1461890c3 (bug 1638711)
Backed out changeset 9eda9f6c5877 (bug 1638711)
Backed out changeset f776c30279f3 (bug 1638711)
Backed out changeset b34546384903 (bug 1638711)
Backed out changeset 47da03dd8365 (bug 1638711)
2020-05-28 04:25:38 +03:00
Matt Woodrow
ca4cbd1711 Bug 1638711 - Convert tests that try to install a content policy for Document loads to use SpecialPowers.loadChromeScript to do so in the parent process. r=kmag,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D76616
2020-05-27 09:39:33 +00:00
Matt Woodrow
3d7f13f789 Bug 1638711 - Fix test_CSP to detect CSP events from the parent process. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75723
2020-05-27 09:39:38 +00:00
Matt Woodrow
b9ceacc239 Bug 1638711 - Allow test_frameNavigation to use the error event to detect when a load was blocked. r=ckerschb
The current state is that we fire error events for content blocking if the error happens synchronously and src was set when the iframe was in-document, or if the error happens asynchronously (from the parent process).
This test is currently setting src before appending the iframe to the document, and thus was expecting no error event to be fired. We have other content security tests that do rely on the error event being fired.

Since we're doing security checks in the parent, the error event now fires, and this changes the test to report success in that case.

Differential Revision: https://phabricator.services.mozilla.com/D75722
2020-05-27 09:39:40 +00:00
Matt Woodrow
74388c26ab Bug 1638711 - Do document security checks in parent process. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75720
2020-05-27 09:39:44 +00:00
Emilio Cobos Álvarez
54fd961a29 Bug 1641245 - Make string comparators not virtual. r=froydnj,necko-reviewers,geckoview-reviewers,jgilbert,agi,valentin
There's no use case for stateful comparators, so they can be just plain
function pointers.

This is used in some hot places like CSS selector matching.

Differential Revision: https://phabricator.services.mozilla.com/D77084
2020-05-27 18:11:12 +00:00
Dorel Luca
34b793064e Backed out 6 changesets (bug 1638711) for Geckoview failures in NavigationDelegateTest.loadUriReferrerSessionFileUrl.CLOSED TREE
Backed out changeset 22a7b8f16c44 (bug 1638711)
Backed out changeset 75d97b8df5ba (bug 1638711)
Backed out changeset 254871b49de9 (bug 1638711)
Backed out changeset 97d1d2390586 (bug 1638711)
Backed out changeset bebe76fca022 (bug 1638711)
Backed out changeset 164b842bea99 (bug 1638711)
2020-05-27 12:28:10 +03:00
Matt Woodrow
3a23e7fd49 Bug 1638711 - Convert tests that try to install a content policy for Document loads to use SpecialPowers.loadChromeScript to do so in the parent process. r=kmag,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D76616
2020-05-27 00:33:19 +00:00
Matt Woodrow
e323917bc6 Bug 1638711 - Fix test_CSP to detect CSP events from the parent process. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75723
2020-05-27 00:33:17 +00:00
Matt Woodrow
ce6af34af6 Bug 1638711 - Allow test_frameNavigation to use the error event to detect when a load was blocked. r=ckerschb
The current state is that we fire error events for content blocking if the error happens synchronously and src was set when the iframe was in-document, or if the error happens asynchronously (from the parent process).
This test is currently setting src before appending the iframe to the document, and thus was expecting no error event to be fired. We have other content security tests that do rely on the error event being fired.

Since we're doing security checks in the parent, the error event now fires, and this changes the test to report success in that case.

Differential Revision: https://phabricator.services.mozilla.com/D75722
2020-05-27 00:32:25 +00:00
Matt Woodrow
edc0d0a35f Bug 1638711 - Do document security checks in parent process. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75720
2020-05-27 00:32:05 +00:00
Matt Woodrow
7b18a9452b Bug 1631405 - Run nsMixedContentBlocker::AsyncOnChannelRedirect checks in the parent for documents, since this is now supported correctly. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75449
2020-05-27 00:31:51 +00:00
Matt Woodrow
5cf1f845a8 Bug 1631405 - Update tests to account for security UI only living in the parent process. r=kmag,ckerschb,webcompat-reviewers,twisniewski
This is mostly changes to handle retrieving the security state asynchronously via the parent process, needing lots of async/await additions.

It also removes the docshell mixed content flag checks (which don't seem to be used in code, only tests), which are mostly still covered by checks of the security UI.

Differential Revision: https://phabricator.services.mozilla.com/D75448
2020-05-27 00:31:25 +00:00
Matt Woodrow
e060a86c42 Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
This removes all docshell nsISecureBrowserUI and mixed content properties, and moves them into CanonicalBrowsingContext/WindowGlobalParent. It makes the mixed content blocker just compute the state for the current load, and then send the results to the parent process, where we update the security state accordingly.

I think we could in the future remove onSecurityChange entirely, and instead just fire an event to the <browser> element notifying it of changes to the queryable securityUI.

Unfortunately we have a lot of existing code that depends on specific ordering between onSecurityChange and onLocationChange, so I had to hook into the RemoteWebProgress implementation in BrowserParent to mimic the same timings.

Differential Revision: https://phabricator.services.mozilla.com/D75447
2020-05-27 00:28:59 +00:00
Bogdan Tara
a54ec3073f Backed out 4 changesets (bug 1631405) for multiple mochitest failures CLOSED TREE
Backed out changeset 9963cc0b23cb (bug 1631405)
Backed out changeset 469ac933ed7c (bug 1631405)
Backed out changeset 0c5f55864268 (bug 1631405)
Backed out changeset 20dcbcc2f3b8 (bug 1631405)
2020-05-27 01:30:20 +03:00
Matt Woodrow
7321550a61 Bug 1631405 - Run nsMixedContentBlocker::AsyncOnChannelRedirect checks in the parent for documents, since this is now supported correctly. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75449
2020-05-26 21:19:45 +00:00
Matt Woodrow
d692732bdd Bug 1631405 - Update tests to account for security UI only living in the parent process. r=kmag,ckerschb,webcompat-reviewers,twisniewski
This is mostly changes to handle retrieving the security state asynchronously via the parent process, needing lots of async/await additions.

It also removes the docshell mixed content flag checks (which don't seem to be used in code, only tests), which are mostly still covered by checks of the security UI.

Differential Revision: https://phabricator.services.mozilla.com/D75448
2020-05-26 21:19:28 +00:00
Matt Woodrow
240d417eb6 Bug 1631405 - Move nsISecureBrowserUI to be owned by the canonical browsing context instead of docshell. r=nika,ckerschb,Gijs,webcompat-reviewers,twisniewski
This removes all docshell nsISecureBrowserUI and mixed content properties, and moves them into CanonicalBrowsingContext/WindowGlobalParent. It makes the mixed content blocker just compute the state for the current load, and then send the results to the parent process, where we update the security state accordingly.

I think we could in the future remove onSecurityChange entirely, and instead just fire an event to the <browser> element notifying it of changes to the queryable securityUI.

Unfortunately we have a lot of existing code that depends on specific ordering between onSecurityChange and onLocationChange, so I had to hook into the RemoteWebProgress implementation in BrowserParent to mimic the same timings.

Differential Revision: https://phabricator.services.mozilla.com/D75447
2020-05-26 21:17:01 +00:00
Christoph Kerschbaumer
159f21fe04 Bug 1638826: Exempt pdfjs from being subject to CSP permits function. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D75787
2020-05-26 12:48:15 +00:00
JulianWels
2cc2e49495 Bug 1625156 - Error page for HTTPS Only Mode. r=fluent-reviewers,ckerschb,nhnt11,flod,nika,johannh,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D72129
2020-05-26 11:45:21 +00:00
Georg Koppen
1bda9aacdf Bug 1640707 - Make sure whitelist_onions is disabled in test_isOriginPotentiallyTrustworthy.js r=ckerschb
In Tor Browser dom.securecontext.whitelist_onions is true by default, so we need a small
patch for tests from bug 1382359 to pass. We would like to upstream that patch, which
is just making sure dom.securecontext.whitelist_onions is false before starting the test.

Differential Revision: https://phabricator.services.mozilla.com/D76726
2020-05-26 08:21:26 +00:00
Narcis Beleuzu
31ca1d2605 Backed out changeset 2b4796470c0b (bug 1638826) for wpt failure on form-action-src-javascript-blocked.sub.html . CLOSED TREE 2020-05-25 13:52:24 +03:00
Christoph Kerschbaumer
00cb73739d Bug 1638826: Make CSP permits function (e.g. restricting base-uri) consult subjectCSP before enforcing CSP. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D75787
2020-05-25 08:24:09 +00:00
Christoph Kerschbaumer
6ae4ad1947 Bug 1422284 - Upgrade insecure requests should only apply to top-level same-origin redirects. r=baku,valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D75259
2020-05-25 08:14:10 +00:00
Andrea Marchesini
0ae464faaa Bug 1639154 - Isolate network cache per first-party when privacy.partition.network_state is set to true - part 2 - tests, r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D75922
2020-05-21 05:41:50 +00:00
Frederik Braun
ab74268189 Bug 1613609 - prototype patch with whitelist for sysrequest r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75064
2020-05-20 13:01:35 +00:00
Dorel Luca
305e9f8c08 Backed out changeset be2d763a80d8 (bug 1613609) for making nightlies not being able to connecto to sites fi add-ons are installed. a=backout DONTBUILD 2020-05-20 06:35:48 +03:00
Frederik Braun
b27d095e3d Bug 1613609 - prototype patch with whitelist for sysrequest r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75064
2020-05-19 08:55:06 +00:00
Mihai Alexandru Michis
a2026344a1 Backed out 2 changesets (bug 1613609) for causing bustages.
CLOSED TREE

Backed out changeset dd6e395dc342 (bug 1613609)
Backed out changeset 5bcb7b13a4ad (bug 1613609)
2020-05-18 16:38:58 +03:00
Christoph Kerschbaumer
a13abcc66d Bug 1632811: Use final URI for CSP reports in case of iframes. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D75326
2020-05-16 16:57:00 +00:00
Frederik Braun
6cdb200d94 Bug 1613609 - prototype patch with whitelist for sysrequest r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75064
2020-05-18 10:59:12 +00:00
Csoregi Natalia
5162f86676 Backed out 2 changesets (bug 1613609) for failures on nsXPConnect.cpp. CLOSED TREE
Backed out changeset c593a7296df4 (bug 1613609)
Backed out changeset 72199fc4ea2b (bug 1613609)
2020-05-18 13:05:12 +03:00
Frederik Braun
7bb9748003 Bug 1613609 - prototype patch with whitelist for sysrequest r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75064
2020-05-18 09:19:28 +00:00
Matt Woodrow
98b902004c Bug 1637487 - Store mixed content security flags as a flags word on Document instead of bools. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75026
2020-05-14 01:27:42 +00:00
Matt Woodrow
2f85a514ca Bug 1637487 - Compute broken flag when we need to use it. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75025
2020-05-14 01:27:24 +00:00
Matt Woodrow
861c02747c Bug 1637487 - Factor out calls to log changes to mixed content security state. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75024
2020-05-14 01:27:11 +00:00
Matt Woodrow
6438ccaaf7 Bug 1637487 - Factor out updating root Document security flags. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75023
2020-05-14 01:27:03 +00:00
Matt Woodrow
7c1f4443d0 Bug 1637487 - Factor out setting of the broken security state flags. r=ckerschb
Factor out broken flag clearing

Differential Revision: https://phabricator.services.mozilla.com/D75022
2020-05-14 01:26:50 +00:00
Matt Woodrow
1b984fae62 Bug 1637487 - Fold the branches for each pref together, since they do the same thing. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75021
2020-05-14 01:26:38 +00:00
Matt Woodrow
8645f20d35 Bug 1637487 - Flatten the mixed content event runner into the calling code, so it's no longer needed. r=ckerschb
This looks like it was necessary a long time ago, but now just runs the same calls as the calling code, so unnecessarily splits the logic into two.

Differential Revision: https://phabricator.services.mozilla.com/D75020
2020-05-14 01:26:25 +00:00
Matt Woodrow
f88593276e Bug 1637487 - Refactor calls to OnSecurityChange to all be a single call at the end of ShouldLoad. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D75019
2020-05-14 01:26:17 +00:00
Matt Woodrow
c47de00726 Bug 1637487 - GetState is infallible, so rely on the result. r=ckerschb
We previously were checking the nsresult inconsistently.

Differential Revision: https://phabricator.services.mozilla.com/D75018
2020-05-14 01:26:05 +00:00
Narcis Beleuzu
53167b2819 Backed out 9 changesets (bug 1637487) for bustages on nsMixedContentBlocker.cpp . CLOSED TREE
Backed out changeset 5633cc2aaa9b (bug 1637487)
Backed out changeset c4f0c757cae0 (bug 1637487)
Backed out changeset 65bb1114df87 (bug 1637487)
Backed out changeset 1a64ef10e773 (bug 1637487)
Backed out changeset d1709ebb7f46 (bug 1637487)
Backed out changeset 286e5ee6517f (bug 1637487)
Backed out changeset 83362625c297 (bug 1637487)
Backed out changeset ab9df2f2d11f (bug 1637487)
Backed out changeset b83f49bc11b0 (bug 1637487)
2020-05-14 02:41:40 +03:00
Matt Woodrow
4f25f45f1f Bug 1637487 - Store mixed content security flags as a flags word on Document instead of bools. r=ckerschb
Depends on D75025

Differential Revision: https://phabricator.services.mozilla.com/D75026
2020-05-13 17:50:34 +00:00
Matt Woodrow
e20645053d Bug 1637487 - Compute broken flag when we need to use it. r=ckerschb
Depends on D75024

Differential Revision: https://phabricator.services.mozilla.com/D75025
2020-05-13 17:50:01 +00:00
Matt Woodrow
7701a47ec5 Bug 1637487 - Factor out calls to log changes to mixed content security state. r=ckerschb
Depends on D75023

Differential Revision: https://phabricator.services.mozilla.com/D75024
2020-05-13 17:49:41 +00:00
Matt Woodrow
c29977cc47 Bug 1637487 - Factor out updating root Document security flags. r=ckerschb
Depends on D75022

Differential Revision: https://phabricator.services.mozilla.com/D75023
2020-05-13 17:49:02 +00:00
Matt Woodrow
4cd51b2599 Bug 1637487 - Factor out setting of the broken security state flags. r=ckerschb
Factor out broken flag clearing

Depends on D75021

Differential Revision: https://phabricator.services.mozilla.com/D75022
2020-05-13 17:48:09 +00:00
Matt Woodrow
d724ad70cf Bug 1637487 - Fold the branches for each pref together, since they do the same thing. r=ckerschb
Depends on D75020

Differential Revision: https://phabricator.services.mozilla.com/D75021
2020-05-13 17:47:36 +00:00
Matt Woodrow
ebf31467af Bug 1637487 - Flatten the mixed content event runner into the calling code, so it's no longer needed. r=ckerschb
This looks like it was necessary a long time ago, but now just runs the same calls as the calling code, so unnecessarily splits the logic into two.

Depends on D75019

Differential Revision: https://phabricator.services.mozilla.com/D75020
2020-05-13 17:46:44 +00:00