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

Issue 2436003002: CSP: Add 'script-sample' to violation reports. (Closed)

Created:
4 years, 2 months ago by Mike West
Modified:
3 years, 9 months ago
CC:
aaj, blink-reviews, blink-reviews-bindings_chromium.org, chromium-reviews, kinuko+watch, lwe, mikispag
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CSP: Add 'sample' to violation reports. This patch sketches out a 'sample' attribute similar to what Firefox has been shipping as 'script-sample' for eons. The key distinctions are: 1. This approach requires opt-in from the site, via a new `'report-sample'` expression in the relevant directive. 2. We're including inline style violations as well. Let's see how the spec discussion goes. Spec: https://github.com/w3c/webappsec-csp/issues/119 Intent to Implement: https://groups.google.com/a/chromium.org/d/msg/blink-dev/6W9r_sX3zTQ/5XCSBUQBEAAJ BUG=606774 Review-Url: https://codereview.chromium.org/2436003002 Cr-Commit-Position: refs/heads/master@{#454232} Committed: https://chromium.googlesource.com/chromium/src/+/f98f5c2ccea76c9d7e76646369e2f51e0c926521

Patch Set 1 #

Patch Set 2 : Tests. #

Patch Set 3 : Rebase. #

Patch Set 4 : Rebase. #

Total comments: 4

Patch Set 5 : rebaseline #

Patch Set 6 : sample #

Patch Set 7 : Tests. #

Total comments: 5

Patch Set 8 : Fix. #

Patch Set 9 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -31 lines) Patch
M third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json View 1 2 3 4 5 6 7 8 4 chunks +40 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/script-sample.html View 1 2 3 4 5 1 chunk +67 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/script-sample-no-opt-in.html View 1 2 3 4 5 6 7 1 chunk +67 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/style-sample.html View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/style-sample-no-opt-in.html View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/eval-blocked-and-sends-report-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.h View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.cpp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/SecurityPolicyViolationEvent.idl View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/SecurityPolicyViolationEventInit.idl View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 2 3 4 5 6 7 8 10 chunks +14 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 2 3 4 5 6 7 8 8 chunks +18 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/SourceListDirective.h View 1 2 3 3 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp View 1 2 3 4 5 6 7 4 chunks +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebPluginContainerImpl.cpp View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -5 lines 0 comments Download

Messages

Total messages: 62 (47 generated)
Mike West
WDYT of this approach, Jochen? If you're not terribly opposed, I'll spec it out and ...
4 years, 1 month ago (2016-10-24 14:09:28 UTC) #8
jochen (gone - plz use gerrit)
yeah, looks good
4 years, 1 month ago (2016-10-24 14:15:38 UTC) #10
Mike West
On 2016/10/24 at 14:15:38, jochen wrote: > yeah, looks good Let's pick this back up. ...
3 years, 10 months ago (2017-02-17 11:01:54 UTC) #17
Mike West
WDYT, Jochen and Andy? CCing aaj@, mikispag@, lwe@. Maybe they'd like to write more tests? ...
3 years, 10 months ago (2017-02-22 11:01:53 UTC) #24
andypaicu
https://codereview.chromium.org/2436003002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/script-sample.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/script-sample.html (right): https://codereview.chromium.org/2436003002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/script-sample.html#newcode76 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/script-sample.html:76: assert_ureached('eval'); Typo here "assert_unreached" https://codereview.chromium.org/2436003002/diff/60001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp File third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp (right): https://codereview.chromium.org/2436003002/diff/60001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp#newcode412 ...
3 years, 10 months ago (2017-02-22 12:47:03 UTC) #29
lwe
On 2017/02/22 12:47:03, andypaicu wrote: > https://codereview.chromium.org/2436003002/diff/60001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/script-sample.html > File > third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/securitypolicyviolation/script-sample.html > (right): > > ...
3 years, 10 months ago (2017-02-22 13:26:44 UTC) #32
Mike West
Ok. Fleshed this out a bit, moved the tests to WPT, and updated the spec. ...
3 years, 10 months ago (2017-02-22 14:54:01 UTC) #40
Mike West
https://codereview.chromium.org/2436003002/diff/120001/third_party/WebKit/LayoutTests/TestExpectations File third_party/WebKit/LayoutTests/TestExpectations (right): https://codereview.chromium.org/2436003002/diff/120001/third_party/WebKit/LayoutTests/TestExpectations#newcode1858 third_party/WebKit/LayoutTests/TestExpectations:1858: crbug.com/692105 external/wpt/content-security-policy/securitypolicyviolation [ Pass ] I'll move over the ...
3 years, 10 months ago (2017-02-22 15:06:37 UTC) #41
andypaicu
https://codereview.chromium.org/2436003002/diff/120001/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/script-sample-no-opt-in.html File third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/script-sample-no-opt-in.html (right): https://codereview.chromium.org/2436003002/diff/120001/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/script-sample-no-opt-in.html#newcode63 third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/script-sample-no-opt-in.html:63: assert_ureached('eval'); The typo is elusive and finds its way ...
3 years, 10 months ago (2017-02-24 09:45:49 UTC) #44
Mike West
Ok, should have actually fixed the typo this time. :) Jochen, WDYT about landing this ...
3 years, 10 months ago (2017-02-24 10:16:57 UTC) #47
jochen (gone - plz use gerrit)
I didn't have a chance to review this CL. Should this have an intent to ...
3 years, 10 months ago (2017-02-24 16:01:58 UTC) #50
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/2436003002/140001
3 years, 9 months ago (2017-03-02 09:00:11 UTC) #53
commit-bot: I haz the power
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/163430) ios-device-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 9 months ago (2017-03-02 09:02:53 UTC) #55
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/2436003002/160001
3 years, 9 months ago (2017-03-02 09:13:44 UTC) #59
commit-bot: I haz the power
3 years, 9 months ago (2017-03-02 11:10:32 UTC) #62
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/f98f5c2ccea76c9d7e76646369e2...

Powered by Google App Engine
This is Rietveld 408576698