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

Issue 2404373003: Experimental Feature: Allow-CSP-From header (Closed)

Created:
4 years, 2 months ago by amalika
Modified:
4 years, 2 months ago
Reviewers:
Mike West
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This is part of an experimental feature in Content Security Policy. This patch introduces a new header Allow-CSP-From that allows the embedded iframe to use a whitelist to enforce upon itself embedder's CSP. BUG=647588 Committed: https://crrev.com/69cc847f5802c6d871836695d5f984db682af776 Cr-Commit-Position: refs/heads/master@{#425955}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Without all those style changes #

Total comments: 9

Patch Set 3 : Changing to parentSecurityOrigin #

Total comments: 4

Patch Set 4 : Adding console message, moving to testharness tests, adding CSPTest #

Patch Set 5 : Adding console message, moving to testharness tests, adding CSPTest #

Total comments: 7

Patch Set 6 : Better format of ContentSecurityPolicyTest.ShouldEnforceEmbeddersPolicy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+318 lines, -17 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_from-header.html View 1 2 3 4 5 1 chunk +91 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html View 4 chunks +17 lines, -17 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-csp-test.js View 1 2 3 4 5 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/respond-with-allow-csp-from-header.php View 1 2 3 4 5 1 chunk +37 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/respond-with-allow-csp-from-multiple-headers.php View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp View 1 2 3 4 5 1 chunk +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp View 1 2 3 4 5 1 chunk +52 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 1 chunk +23 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPNames.in View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 27 (12 generated)
amalika
https://codereview.chromium.org/2404373003/diff/1/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp File third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp (right): https://codereview.chromium.org/2404373003/diff/1/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode314 third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp:314: bool ContentSecurityPolicy::checkAllowBlanketEnforcement( This is the most important function. After ...
4 years, 2 months ago (2016-10-11 19:06:46 UTC) #2
amalika
it turns out someone already committed "blink formatting", I just had to rebase
4 years, 2 months ago (2016-10-13 10:33:49 UTC) #3
Mike West
On 2016/10/13 at 10:33:49, amalika wrote: > it turns out someone already committed "blink formatting", ...
4 years, 2 months ago (2016-10-13 10:40:18 UTC) #4
Mike West
Thanks! Here's some feedback! https://codereview.chromium.org/2404373003/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/2404373003/diff/20001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp#newcode318 third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp:318: response.url().protocolIsAbout() || response.url().protocolIs("blob") || Nit: ...
4 years, 2 months ago (2016-10-13 11:01:42 UTC) #5
amalika
Should we support multiple URLs returned from Allow-CSP-From header? As per discussion on github, seemed ...
4 years, 2 months ago (2016-10-14 08:21:26 UTC) #6
Mike West
On 2016/10/14 at 08:21:26, amalika wrote: > Should we support multiple URLs returned from Allow-CSP-From ...
4 years, 2 months ago (2016-10-14 08:43:40 UTC) #7
Mike West
Looking good! A little more feedback, and I'm looking at the layout tests now. https://codereview.chromium.org/2404373003/diff/40001/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp ...
4 years, 2 months ago (2016-10-14 09:01:18 UTC) #8
Mike West
https://codereview.chromium.org/2404373003/diff/40001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_header-same-origin.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_header-same-origin.html (right): https://codereview.chromium.org/2404373003/diff/40001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_header-same-origin.html#newcode10 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_header-same-origin.html:10: injectFrameWithCSP(url, csp, EXPECT_LOAD, SAME_ORIGIN); We'll also need to test ...
4 years, 2 months ago (2016-10-14 09:08:20 UTC) #9
amalika
I did not know how to add two t.done() testing for two post messages. So ...
4 years, 2 months ago (2016-10-17 13:21:53 UTC) #10
Mike West
Looking good! https://codereview.chromium.org/2404373003/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_from-header.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_from-header.html (right): https://codereview.chromium.org/2404373003/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_from-header.html#newcode15 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/allow_csp_from-header.html:15: url = urlWithAlloCspFrom(SAME_ORIGIN, ""); s/Allo/Allow/g https://codereview.chromium.org/2404373003/diff/80001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/child-csp-test.js File ...
4 years, 2 months ago (2016-10-17 14:54:28 UTC) #13
amalika
4 years, 2 months ago (2016-10-18 08:36:36 UTC) #17
Mike West
LGTM, if the bots are happy. Thanks for going through a few iterations on this! ...
4 years, 2 months ago (2016-10-18 08:41:17 UTC) #20
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/2404373003/110001
4 years, 2 months ago (2016-10-18 14:30:50 UTC) #24
commit-bot: I haz the power
Committed patchset #6 (id:110001)
4 years, 2 months ago (2016-10-18 14:35:24 UTC) #25
commit-bot: I haz the power
4 years, 2 months ago (2016-10-18 14:37:32 UTC) #27
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/69cc847f5802c6d871836695d5f984db682af776
Cr-Commit-Position: refs/heads/master@{#425955}

Powered by Google App Engine
This is Rietveld 408576698