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

Issue 2421473004: CSP: Fire 'SecurityPolicyViolation' on the offending element. (Closed)

Created:
4 years, 2 months ago by Mike West
Modified:
4 years, 2 months ago
CC:
blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, blink-reviews-style_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, Nate Chapin, kinuko+watch, loading-reviews_chromium.org, rwlbuis, sof, tyoshino+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CSP: Fire 'SecurityPolicyViolation' on the offending element. If we can identify a specific element for a CSP violation (e.g. in the cases of inline script, style, or event handlers), then target those elements when firing a 'SecurityPolicyViolation' event. We'll also need to ensure that the event bubbles so that we don't break existing collection endpoints that listen on 'Document'. Committed: https://crrev.com/357d8e12ff388c450cdc431a3e5865737d84d2e2 Cr-Commit-Position: refs/heads/master@{#425937}

Patch Set 1 #

Patch Set 2 : Ugh. #

Total comments: 1

Patch Set 3 : Tests. #

Patch Set 4 : Rebase. #

Total comments: 12

Patch Set 5 : Tests. #

Total comments: 4

Patch Set 6 : tests. #

Patch Set 7 : postTask. #

Patch Set 8 : Rebase. #

Patch Set 9 : ugh #

Total comments: 2

Patch Set 10 : yay #

Patch Set 11 : Test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+414 lines, -322 lines) Patch
M third_party/WebKit/LayoutTests/fast/events/constructors/security-policy-violation-event-constructor.html View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/constructors/security-policy-violation-event-constructor-expected.txt View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-handler-allowed.html View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/scripthash-handler-blocked.html View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php View 1 2 3 4 5 6 7 8 1 chunk +38 lines, -60 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/securitypolicyviolation-helper.js View 1 2 3 4 5 6 7 8 1 chunk +25 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html View 1 2 3 4 5 6 7 8 9 1 chunk +160 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/strict-dynamic/script-src-multiple-allowed.php View 1 2 3 4 5 6 7 8 5 chunks +13 lines, -77 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/strict-dynamic/script-src-strict-dynamic.html View 1 2 3 4 5 6 7 8 5 chunks +13 lines, -77 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/strict-dynamic/script-src-strict-dynamic-whitelist.html View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -26 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptController.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp View 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptLoader.cpp View 1 chunk +1 line, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/StyleElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h View 3 chunks +11 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 2 3 4 5 6 7 9 chunks +22 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h View 1 2 3 4 5 6 7 5 chunks +22 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 2 3 4 5 6 7 8 9 7 chunks +49 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp View 1 2 3 4 5 6 7 8 9 10 6 chunks +8 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLMetaElement.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/HttpEquiv.h View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/HttpEquiv.cpp View 1 2 3 4 5 6 7 8 4 chunks +10 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/web/WebPluginContainerImpl.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 53 (37 generated)
Mike West
Philip: Since you know things about events, could you take a look at the small ...
4 years, 2 months ago (2016-10-13 15:23:08 UTC) #4
foolip
https://codereview.chromium.org/2421473004/diff/20001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp File third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp (right): https://codereview.chromium.org/2421473004/diff/20001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode1208 third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp:1208: if (element) { Is it possible that this element ...
4 years, 2 months ago (2016-10-13 15:37:27 UTC) #5
Mike West
On 2016/10/13 at 15:37:27, foolip wrote: > https://codereview.chromium.org/2421473004/diff/20001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp > File third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp (right): > > https://codereview.chromium.org/2421473004/diff/20001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode1208 ...
4 years, 2 months ago (2016-10-13 19:00:52 UTC) #8
Mike West
I got some good feedback from Anne at https://github.com/w3c/webappsec-csp/issues/128. The latest version of the patch ...
4 years, 2 months ago (2016-10-14 08:28:37 UTC) #12
foolip
https://codereview.chromium.org/2421473004/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html (right): https://codereview.chromium.org/2421473004/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html#newcode1 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html:1: <!doctype html> Whatever the spec'd behavior, some test where ...
4 years, 2 months ago (2016-10-14 09:17:23 UTC) #17
jochen (gone - plz use gerrit)
lgtm
4 years, 2 months ago (2016-10-14 09:18:32 UTC) #18
Mike West
Thanks to you both! https://codereview.chromium.org/2421473004/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html (right): https://codereview.chromium.org/2421473004/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html#newcode1 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html:1: <!doctype html> On 2016/10/14 at ...
4 years, 2 months ago (2016-10-14 12:26:43 UTC) #23
foolip
https://codereview.chromium.org/2421473004/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html (right): https://codereview.chromium.org/2421473004/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html#newcode6 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html:6: async_test(t => { Optional nit: promise_test might get rid ...
4 years, 2 months ago (2016-10-14 12:51:22 UTC) #24
foolip
On 2016/10/14 12:26:43, Mike West wrote: > > Is the precise timing nailed down in ...
4 years, 2 months ago (2016-10-14 13:00:24 UTC) #25
Mike West
foolip@: Since you like boring details, help me with this boring detail. :P https://codereview.chromium.org/2421473004/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/targeting.html File ...
4 years, 2 months ago (2016-10-17 11:44:41 UTC) #40
foolip
https://codereview.chromium.org/2421473004/diff/160001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php (right): https://codereview.chromium.org/2421473004/diff/160001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php#newcode15 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php:15: 49: true, On 2016/10/17 11:44:40, Mike West wrote: > ...
4 years, 2 months ago (2016-10-17 12:04:28 UTC) #41
Mike West
On 2016/10/17 at 12:04:28, foolip wrote: > https://codereview.chromium.org/2421473004/diff/160001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php > File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php (right): > > https://codereview.chromium.org/2421473004/diff/160001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/nonces/script-enforce-blocked.php#newcode15 ...
4 years, 2 months ago (2016-10-17 12:24:02 UTC) #44
foolip
On 2016/10/17 12:24:02, Mike West wrote: > On 2016/10/17 at 12:04:28, foolip wrote: > > ...
4 years, 2 months ago (2016-10-17 12:27:22 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2421473004/200001
4 years, 2 months ago (2016-10-18 08:39:12 UTC) #50
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 2 months ago (2016-10-18 10:02:51 UTC) #51
commit-bot: I haz the power
4 years, 2 months ago (2016-10-18 10:05:15 UTC) #53
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/357d8e12ff388c450cdc431a3e5865737d84d2e2
Cr-Commit-Position: refs/heads/master@{#425937}

Powered by Google App Engine
This is Rietveld 408576698