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

Issue 2146633002: Enable checking for Content Security Policies before loading an external worklet script. (Closed)

Created:
4 years, 5 months ago by Gleb Lanbin
Modified:
4 years, 4 months ago
Reviewers:
ikilpatrick
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable checking for Content Security Policies before loading an external worklet script. BUG=567358

Patch Set 1 #

Total comments: 1

Patch Set 2 : fixed comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -2 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html View 1 chunk +22 lines, -0 lines 1 comment Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked-expected.txt View 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/worklet/Worklet.cpp View 1 1 chunk +3 lines, -2 lines 1 comment Download

Messages

Total messages: 14 (6 generated)
Gleb Lanbin
4 years, 5 months ago (2016-07-12 20:17:17 UTC) #4
Gleb Lanbin
Ian, just a friendly reminder that I'm waiting for your review.
4 years, 5 months ago (2016-07-18 16:26:34 UTC) #5
ikilpatrick
lgtm but wait for mkwst. +mkwst +nhiroki & +yhirano for sanity check as well. mkwst/nhiroki/yhirano ...
4 years, 5 months ago (2016-07-20 17:56:17 UTC) #7
yhirano
> mkwst/nhiroki/yhirano (this is un-related to this patch) I was just quickly > reading through ...
4 years, 5 months ago (2016-07-21 05:09:48 UTC) #8
yhirano
https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html (right): https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html#newcode15 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html:15: }).catch(function(error) { This catches the assert_unreached exception. I would ...
4 years, 5 months ago (2016-07-21 05:16:56 UTC) #9
Mike West
https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/Source/modules/worklet/Worklet.cpp File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/Source/modules/worklet/Worklet.cpp#newcode30 third_party/WebKit/Source/modules/worklet/Worklet.cpp:30: return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(NetworkError, "Access to '" + scriptURL.elidedString() + ...
4 years, 5 months ago (2016-07-21 07:26:48 UTC) #10
Gleb Lanbin
On 2016/07/21 07:26:48, Mike West (OOO until 25th) wrote: > https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/Source/modules/worklet/Worklet.cpp > File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right): ...
4 years, 5 months ago (2016-07-26 00:51:28 UTC) #11
Gleb Lanbin
4 years, 4 months ago (2016-07-27 23:23:41 UTC) #12
On 2016/07/26 00:51:28, glebl wrote:
> On 2016/07/21 07:26:48, Mike West (OOO until 25th) wrote:
> >
>
https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/Sour...
> > File third_party/WebKit/Source/modules/worklet/Worklet.cpp (right):
> > 
> >
>
https://codereview.chromium.org/2146633002/diff/60001/third_party/WebKit/Sour...
> > third_party/WebKit/Source/modules/worklet/Worklet.cpp:30: return
> > ScriptPromise::rejectWithDOMException(scriptState,
> > DOMException::create(NetworkError, "Access to '" + scriptURL.elidedString()
+
> "'
> > is denied by document's Content Security Policies."));
> > Hrm. This seems inconsistent with the way we handle most other requests. It
> > doesn't handle redirect responses, for instance.
> > 
> > We currently do most of the CSP checks in `FrameFetchContext::canRequest`
> > (called from `ResourceFetcher`). Does this loader not route through that
> > mechanism? It appears that we're checking for worker requests in
> > `ContentSecurityPolicy::allowRequest`, for instance.
> 
> I tried to change Worklet code to use ScriptResource instead of the current
> approach(WorkerScriptLoader).
> It worked fine.
> Here is the patch http://crrev.com/2178223002. Could you please take a look?
> 
> If it looks acceptable to you then I will just abandon this patch in favor the
> one with ScriptResource.

This patch is abandoned in favor of http://crrev.com/2178223002 which is based
on Mike's recommendation to use ScriptResource.

Powered by Google App Engine
This is Rietveld 408576698