Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Issue 334413004: Add URL origin checks for Service Worker (un)registration (Closed)

Created:
6 years, 6 months ago by falken
Modified:
6 years, 6 months ago
Reviewers:
michaeln, Tom Sepez
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, nhiroki, darin-cc_chromium.org, horo+watch_chromium.org, alecflett+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Add URL origin checks for Service Worker (un)registration Now the browser will register or unregister a Service Worker only if document url, scope, and script url have the same origin. This patch removes TODOs for adding SW to ChildProcessSecurityPolicy, since it turns out the only security check needed here is the URL origin one. SW is expected to be enabled always, not a permission granted per-process. BUG=311631 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278326

Patch Set 1 #

Total comments: 2

Patch Set 2 : move out of CPSP #

Total comments: 3

Patch Set 3 : add todo #

Patch Set 4 : better comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -73 lines) Patch
M content/browser/service_worker/service_worker_dispatcher_host.cc View 1 2 3 5 chunks +34 lines, -15 lines 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host_unittest.cc View 4 chunks +113 lines, -58 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
falken
Michael and Tom, could you please review? Context: Adding SW to CPSP is a prerequisite ...
6 years, 6 months ago (2014-06-17 09:26:46 UTC) #1
Tom Sepez
https://codereview.chromium.org/334413004/diff/1/content/browser/child_process_security_policy_impl.cc File content/browser/child_process_security_policy_impl.cc (right): https://codereview.chromium.org/334413004/diff/1/content/browser/child_process_security_policy_impl.cc#newcode893 content/browser/child_process_security_policy_impl.cc:893: bool ChildProcessSecurityPolicyImpl::CanRegisterServiceWorker( These don't have to live in CPSP ...
6 years, 6 months ago (2014-06-17 17:43:19 UTC) #2
Tom Sepez
Alternatively, if you want to honor site isolation, you'd need to check CanAccessCookiesForOrigin() in the ...
6 years, 6 months ago (2014-06-17 23:40:32 UTC) #3
michaeln
https://codereview.chromium.org/334413004/diff/1/content/browser/child_process_security_policy_impl.cc File content/browser/child_process_security_policy_impl.cc (right): https://codereview.chromium.org/334413004/diff/1/content/browser/child_process_security_policy_impl.cc#newcode898 content/browser/child_process_security_policy_impl.cc:898: document_url.GetOrigin() == script_url.GetOrigin(); These same-origin checks are not a ...
6 years, 6 months ago (2014-06-17 23:50:30 UTC) #4
falken
Thanks for the comments! Let me back up a bit. As reasoned in http://crbug.com/365201, I'd ...
6 years, 6 months ago (2014-06-18 00:01:31 UTC) #5
michaeln1
On 2014/06/18 00:01:31, falken wrote: > Thanks for the comments! Let me back up a ...
6 years, 6 months ago (2014-06-18 00:36:33 UTC) #6
falken
On 2014/06/18 00:36:33, michaeln1 wrote: > On 2014/06/18 00:01:31, falken wrote: > > Thanks for ...
6 years, 6 months ago (2014-06-18 01:17:50 UTC) #7
falken
I've retitled/redescribed this patch. It just adds URL origin checks and removes TODOs for CPSP ...
6 years, 6 months ago (2014-06-18 01:34:11 UTC) #8
falken
On 2014/06/18 01:34:11, falken wrote: > I've retitled/redescribed this patch. It just adds URL origin ...
6 years, 6 months ago (2014-06-18 09:36:56 UTC) #9
Tom Sepez
Thanks. CPSP LGTM since you're no longer modifying it :).
6 years, 6 months ago (2014-06-18 17:18:26 UTC) #10
michaeln
lgtm https://codereview.chromium.org/334413004/diff/40001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/334413004/diff/40001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode43 content/browser/service_worker/service_worker_dispatcher_host.cc:43: document_url.GetOrigin() == script_url.GetOrigin(); can you add a todo ...
6 years, 6 months ago (2014-06-19 00:04:50 UTC) #11
falken
https://codereview.chromium.org/334413004/diff/40001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/334413004/diff/40001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode43 content/browser/service_worker/service_worker_dispatcher_host.cc:43: document_url.GetOrigin() == script_url.GetOrigin(); On 2014/06/19 00:04:50, michaeln wrote: > ...
6 years, 6 months ago (2014-06-19 00:23:34 UTC) #12
falken
The CQ bit was checked by falken@chromium.org
6 years, 6 months ago (2014-06-19 00:33:35 UTC) #13
michaeln
https://codereview.chromium.org/334413004/diff/40001/content/browser/service_worker/service_worker_dispatcher_host.cc File content/browser/service_worker/service_worker_dispatcher_host.cc (right): https://codereview.chromium.org/334413004/diff/40001/content/browser/service_worker/service_worker_dispatcher_host.cc#newcode43 content/browser/service_worker/service_worker_dispatcher_host.cc:43: document_url.GetOrigin() == script_url.GetOrigin(); On 2014/06/19 00:23:34, falken wrote: > ...
6 years, 6 months ago (2014-06-19 00:35:46 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/falken@chromium.org/334413004/80001
6 years, 6 months ago (2014-06-19 00:36:28 UTC) #15
commit-bot: I haz the power
6 years, 6 months ago (2014-06-19 11:31:42 UTC) #16
Message was sent while issue was closed.
Change committed as 278326

Powered by Google App Engine
This is Rietveld 408576698