[ServiceWorker] Don't check the origin equality when disable-web-security flag is set.
When "disable-web-security" flag is set, we don't check the origin equality in Blink.
So we shouldn't check it in content side.
BUG=619294, 630495, 630496
Committed: https://crrev.com/c19aeb3cd6b368a2ba4e46bd76fefe42a7f11e44
Cr-Commit-Position: refs/heads/master@{#408948}
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/43366) ios-device-gn on ...
4 years, 4 months ago
(2016-07-29 05:36:28 UTC)
#4
Description was changed from ========== [ServiceWorker] Don't check the origin equality when disable-web-security flag is ...
4 years, 4 months ago
(2016-07-29 10:56:03 UTC)
#12
Description was changed from
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
BUG=619294,630495,630496
==========
to
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't the origin equality in Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
==========
horo
Description was changed from ========== [ServiceWorker] Don't check the origin equality when disable-web-security flag is ...
4 years, 4 months ago
(2016-07-29 10:56:18 UTC)
#13
Description was changed from
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't the origin equality in Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
==========
to
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't check the origin equality in
Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
==========
4 years, 4 months ago
(2016-08-01 03:18:37 UTC)
#19
+shimazu@ to reviewers
nhiroki
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service_worker/service_worker_browsertest.cc File content/browser/service_worker/service_worker_browsertest.cc (right): https://codereview.chromium.org/2196633002/diff/40001/content/browser/service_worker/service_worker_browsertest.cc#newcode1919 content/browser/service_worker/service_worker_browsertest.cc:1919: Can you add a comment about what this test ...
4 years, 4 months ago
(2016-08-01 04:32:45 UTC)
#20
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/service_worker/disable_web_security_unregister.html File content/test/data/service_worker/disable_web_security_unregister.html (right): https://codereview.chromium.org/2196633002/diff/40001/content/test/data/service_worker/disable_web_security_unregister.html#newcode7 content/test/data/service_worker/disable_web_security_unregister.html:7: .then(reg => reg.unregister() ) Extra space before the last ...
4 years, 4 months ago
(2016-08-01 05:06:21 UTC)
#21
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service_worker/service_worker_browsertest.cc File content/browser/service_worker/service_worker_browsertest.cc (right): https://codereview.chromium.org/2196633002/diff/40001/content/browser/service_worker/service_worker_browsertest.cc#newcode1919 content/browser/service_worker/service_worker_browsertest.cc:1919: On 2016/08/01 04:32:45, nhiroki wrote: > Can you add ...
4 years, 4 months ago
(2016-08-01 07:40:56 UTC)
#24
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service...
File content/browser/service_worker/service_worker_browsertest.cc (right):
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service...
content/browser/service_worker/service_worker_browsertest.cc:1919:
On 2016/08/01 04:32:45, nhiroki wrote:
> Can you add a comment about what this test confirms?
Done.
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service...
content/browser/service_worker/service_worker_browsertest.cc:1957:
net::EmbeddedTestServer cross_origin_server_;
On 2016/08/01 04:32:45, nhiroki wrote:
> Can you move this to the private section?
Done.
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service...
File content/browser/service_worker/service_worker_dispatcher_host.cc (right):
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service...
content/browser/service_worker/service_worker_dispatcher_host.cc:71:
switches::kDisableWebSecurity)) &&
On 2016/08/01 04:32:45, nhiroki wrote:
> Checking the flag whenever matching origins could be error-prone. How about
> making AllOriginsMatch() to accept variable length arguments and also checking
> the flag in the function like this?
>
> /* In class ServiceWorkerUtils */
>
> // Returns true if all given urls have the same origin or
> // '--disable-web-security' flag is specified.
> template <typename... Args>
> static bool AllOriginsMatch(const GURL& url, const Args&... urls) {
> if (base::CommandLine::ForCurrentProcess()->HasSwitch(
> switches::kDisableWebSecurity))
> return true;
> for (const GURL& u : { urls... }) {
> if (url.GetOrigin() != u.GetOrigin())
> return false;
> }
> return true;
> }
>
> Then,
>
> /* In CanUnregisterServiceWorker() etc */
> return ServiceWorkerUtils::AllOriginsMatch<GURL>(document_url, pattern) &&
> OriginCanAccessServiceWorkers(document_url) &&
> OriginCanAccessServiceWorkers(pattern);
Done.
I introduced PassOriginEqualitySecurityCheck().
https://codereview.chromium.org/2196633002/diff/40001/content/browser/service...
content/browser/service_worker/service_worker_dispatcher_host.cc:83:
switches::kDisableWebSecurity);
On 2016/08/01 04:32:45, nhiroki wrote:
> Just to confirm: This flag has an effect only when --user-data-dir flag is
also
> specified, right?
If "user-data-dir" flag is not set, "disable-web-security" flag doesn't disable
the same-origin policy in Blink side.
See ChromeContentBrowserClient::OverrideWebkitPrefs().
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
File content/test/data/service_worker/disable_web_security_unregister.html
(right):
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
content/test/data/service_worker/disable_web_security_unregister.html:5:
iframe.onload = (_ => {
On 2016/08/01 04:32:45, nhiroki wrote:
> Can you verify iframe is on a different origin from parent frame's origin? For
> example,
>
> if (iframe.location.origin == document.location.origin) {
> document.title = "FAIL";
> return;
> }
Done.
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
content/test/data/service_worker/disable_web_security_unregister.html:7:
.then(reg => reg.unregister() )
On 2016/08/01 05:06:20, shimazu wrote:
> Extra space before the last ')'
Done.
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
content/test/data/service_worker/disable_web_security_unregister.html:7:
.then(reg => reg.unregister() )
On 2016/08/01 05:06:20, shimazu wrote:
> +2 indent?
>
> # There seems to be two types of coding style in this directory... which is
> correct?
>
> = Type 1 =
> func()
> .then(function() {
> return;
> })
>
> = Type 2 =
> func().then(function() {
> return;
> })
Done.
We use type 2.
See http://www.chromium.org/blink/serviceworker/testinghttps://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
File content/test/data/service_worker/disable_web_security_update.html (right):
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
content/test/data/service_worker/disable_web_security_update.html:5:
iframe.onload = (_ => {
On 2016/08/01 04:32:45, nhiroki wrote:
> ditto (origin check)
Done.
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
content/test/data/service_worker/disable_web_security_update.html:6:
iframe.contentWindow.navigator.serviceWorker.ready
On 2016/08/01 05:06:20, shimazu wrote:
> +2 indent?
Done.
https://codereview.chromium.org/2196633002/diff/40001/content/test/data/servi...
content/test/data/service_worker/disable_web_security_update.html:7: .then(reg
=> reg.update() )
On 2016/08/01 05:06:20, shimazu wrote:
> Extra space before the last ')'
Done.
shimazu
lgtm
4 years, 4 months ago
(2016-08-01 07:50:26 UTC)
#25
lgtm
nhiroki
lgtm with a nit https://codereview.chromium.org/2196633002/diff/60001/content/common/service_worker/service_worker_utils.cc File content/common/service_worker/service_worker_utils.cc (right): https://codereview.chromium.org/2196633002/diff/60001/content/common/service_worker/service_worker_utils.cc#newcode12 content/common/service_worker/service_worker_utils.cc:12: #include "content/public/common/content_switches.h" These inclusions are ...
4 years, 4 months ago
(2016-08-01 08:21:25 UTC)
#26
Description was changed from ========== [ServiceWorker] Don't check the origin equality when disable-web-security flag is ...
4 years, 4 months ago
(2016-08-01 12:43:11 UTC)
#34
Message was sent while issue was closed.
Description was changed from
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't check the origin equality in
Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
==========
to
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't check the origin equality in
Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
==========
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago
(2016-08-01 12:43:12 UTC)
#35
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
commit-bot: I haz the power
Description was changed from ========== [ServiceWorker] Don't check the origin equality when disable-web-security flag is ...
4 years, 4 months ago
(2016-08-01 12:45:24 UTC)
#36
Message was sent while issue was closed.
Description was changed from
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't check the origin equality in
Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
==========
to
==========
[ServiceWorker] Don't check the origin equality when disable-web-security flag
is set.
When "disable-web-security" flag is set, we don't check the origin equality in
Blink.
So we shouldn't check it in content side.
BUG=619294,630495,630496
Committed: https://crrev.com/c19aeb3cd6b368a2ba4e46bd76fefe42a7f11e44
Cr-Commit-Position: refs/heads/master@{#408948}
==========
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/c19aeb3cd6b368a2ba4e46bd76fefe42a7f11e44 Cr-Commit-Position: refs/heads/master@{#408948}
4 years, 4 months ago
(2016-08-01 12:45:26 UTC)
#37
Issue 2196633002: [ServiceWorker] Don't check the origin equality when disable-web-security flag is set.
(Closed)
Created 4 years, 4 months ago by horo
Modified 4 years, 4 months ago
Reviewers: nhiroki, shimazu
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 21