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

Issue 2896833002: Added validation of the policy specified in the 'csp' attribute (Closed)

Created:
3 years, 7 months ago by andypaicu
Modified:
3 years, 6 months ago
Reviewers:
Mike West
CC:
blink-reviews, blink-reviews-frames_chromium.org, blink-reviews-html_chromium.org, blink-reviews-w3ctests_chromium.org, chromium-reviews, dglazkov+blink
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Added validation of the policy specified in the 'csp' attribute Spec: https://w3c.github.io/webappsec-csp/embedded/#csp-attribute The 'csp' attribute is supposed to be validated as a serialized-policy and set to null if not a valid one Re-used the existing wpt test that documents this functionality Fixed the expected and actual order in said test as it was reversed BUG=647588 Review-Url: https://codereview.chromium.org/2896833002 Cr-Commit-Position: refs/heads/master@{#475487} Committed: https://chromium.googlesource.com/chromium/src/+/4124bfba87179d73b33c54d6add5b2ac82a090b4

Patch Set 1 #

Patch Set 2 : Rebase-update as the patch was failing #

Patch Set 3 : Fixed issue with the renaming of the embedding-csp header #

Total comments: 10

Patch Set 4 : Fixed incomplete validation. Added more tests inspired by existing source parsing tests. #

Total comments: 3

Patch Set 5 : Moved everything to ContentSecurityPolicy #

Total comments: 12

Patch Set 6 : Moved everything to ContentSecurityPolicy #

Patch Set 7 : Code Review suggestions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -87 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/required_csp-header.html View 1 2 2 chunks +9 lines, -6 lines 0 comments Download
D third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/required_csp-header-invalid-format.html View 1 1 chunk +0 lines, -70 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/support/testharness-helper.sub.js View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp View 1 2 3 4 5 6 1 chunk +92 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 43 (33 generated)
andypaicu
3 years, 7 months ago (2017-05-22 14:08:47 UTC) #4
Mike West
Thanks! The implementation looks good, sorry it took me so long to get to this ...
3 years, 7 months ago (2017-05-23 19:21:37 UTC) #16
andypaicu
Modified the way validation is done to simulate creating a CSPDirectiveList and catching whatever errors ...
3 years, 7 months ago (2017-05-26 14:41:09 UTC) #19
Mike West
https://codereview.chromium.org/2896833002/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/2896833002/diff/60001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp#newcode995 third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp:995: CSPDirectiveList::Create(policy, begin, end, header_type, header_source); I think this will ...
3 years, 6 months ago (2017-05-29 07:46:21 UTC) #22
andypaicu
On 2017/05/29 at 07:46:21, mkwst wrote: > https://codereview.chromium.org/2896833002/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/2896833002/diff/60001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp#newcode995 ...
3 years, 6 months ago (2017-05-29 13:45:24 UTC) #28
andypaicu
3 years, 6 months ago (2017-05-29 13:46:03 UTC) #29
Mike West
LGTM % nits. Thanks for working on this! https://codereview.chromium.org/2896833002/diff/80001/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/required_csp-header.html File third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/required_csp-header.html (right): https://codereview.chromium.org/2896833002/diff/80001/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/required_csp-header.html#newcode23 third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/required_csp-header.html:23: "expected": ...
3 years, 6 months ago (2017-05-29 13:49:31 UTC) #30
andypaicu
Thank you very much Mike for bearing with me through this. I've raised crbug.com/726724 for ...
3 years, 6 months ago (2017-05-30 08:51:22 UTC) #35
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/2896833002/120001
3 years, 6 months ago (2017-05-30 10:37:43 UTC) #40
commit-bot: I haz the power
3 years, 6 months ago (2017-05-30 10:42:35 UTC) #43
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/4124bfba87179d73b33c54d6add5...

Powered by Google App Engine
This is Rietveld 408576698