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

Issue 2372563002: Adding Embedding-CSP HTTP header (Closed)

Created:
4 years, 2 months ago by amalika
Modified:
4 years, 2 months ago
Reviewers:
Mike West
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, 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

Adding and sending Embedding-CSP HTTP header Also, setting requiredCSP on FrameLoader to ensure that we record the CSP value we used when sending the FrameLoadRequest BUG=647588 Committed: https://crrev.com/ecf8bb9b85922dbed58632e269d579deb06ef58b Cr-Commit-Position: refs/heads/master@{#424124}

Patch Set 1 #

Patch Set 2 : Minus working tests #

Patch Set 3 : Adding tests, but this patch needs to be rebased on the first patch that contains csp attribute #

Patch Set 4 : Rebasing #

Total comments: 1

Patch Set 5 : Adding redirect tests + LocalDOMWindow requiredCSP update #

Patch Set 6 : Adding another redirect test #

Patch Set 7 : Check for ascii and add console error message #

Total comments: 6

Patch Set 8 : Moving requiredCSP to FrameLoader #

Total comments: 3

Patch Set 9 : Separating into two functions #

Total comments: 10

Patch Set 10 : Adding a test in FrameFetchContextModifyRequestTest #

Patch Set 11 : Adding a test in FrameFetchContextModifyRequestTest #

Total comments: 8

Patch Set 12 : Addressing comments #

Total comments: 1

Patch Set 13 : ASCII DCHECK and a comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+268 lines, -28 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +115 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header.php View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchContext.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +82 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +23 lines, -3 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: 46 (26 generated)
Mike West
This is a good start! I think we're going to need a slightly different approach, ...
4 years, 2 months ago (2016-09-27 12:14:50 UTC) #12
Nico
Please don't pick all the trybots you can find. This patch ran on the bot ...
4 years, 2 months ago (2016-09-27 15:47:08 UTC) #13
blink-reviews
I am sorry about this. That was indeed a bad idea to manually choose some ...
4 years, 2 months ago (2016-09-27 17:45:43 UTC) #14
chromium-reviews
I am sorry about this. That was indeed a bad idea to manually choose some ...
4 years, 2 months ago (2016-09-27 17:45:43 UTC) #15
amalika
Preliminary version, rebased on Issue 2378643002 Patch 20001: It currently lacks validation of csp value.
4 years, 2 months ago (2016-09-28 12:53:21 UTC) #16
amalika
Decided that the validation of the csp value would be done in a separate patch
4 years, 2 months ago (2016-09-29 12:57:51 UTC) #18
amalika
https://codereview.chromium.org/2372563002/diff/180001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php (right): https://codereview.chromium.org/2372563002/diff/180001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php#newcode4 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php:4: header("Embedding-CSP: " + $value); From my understanding header() function ...
4 years, 2 months ago (2016-09-29 13:01:14 UTC) #19
Mike West
https://codereview.chromium.org/2372563002/diff/180001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php (right): https://codereview.chromium.org/2372563002/diff/180001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php#newcode4 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php:4: header("Embedding-CSP: " + $value); On 2016/09/29 at 13:01:14, amalika ...
4 years, 2 months ago (2016-09-29 13:33:13 UTC) #20
amalika
In this patch requiredCSP is moved from LocalDOMWindow to FrameLoader. A few concerns: - AddingOutgoingSecurityHeaders ...
4 years, 2 months ago (2016-09-30 11:02:31 UTC) #21
Mike West
https://codereview.chromium.org/2372563002/diff/200001/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp File third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp (right): https://codereview.chromium.org/2372563002/diff/200001/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp#newcode125 third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp:125: document().addConsoleMessage(ConsoleMessage::create(OtherMessageSource, ErrorMessageLevel, "'csp' attribute contains non-ASCII characters: " + ...
4 years, 2 months ago (2016-09-30 13:11:49 UTC) #22
amalika
I separated into two functions but not sure that's what you wanted because addOutgoingSecurityHeaders still ...
4 years, 2 months ago (2016-10-04 08:31:59 UTC) #24
commit-bot: I haz the power
This CL has an open dependency (Issue 2378643002 Patch 140001). Please resolve the dependency and ...
4 years, 2 months ago (2016-10-04 08:32:09 UTC) #26
Mike West
https://codereview.chromium.org/2372563002/diff/220001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html (right): https://codereview.chromium.org/2372563002/diff/220001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html#newcode79 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html:79: i.src = '../../resources/redir.php?url=' + redirect_url; Since you do this ...
4 years, 2 months ago (2016-10-06 08:00:51 UTC) #27
amalika
- Renaming older tests in FrameFetchContext - Adding a test for EmbeddingCSP header - Adding ...
4 years, 2 months ago (2016-10-06 13:06:02 UTC) #28
Mike West
Looking pretty good! https://codereview.chromium.org/2372563002/diff/260001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php (right): https://codereview.chromium.org/2372563002/diff/260001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php#newcode8 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/resources/get-embedding-csp-header-and-respond.php:8: response['embedding_csp'] = "<?php echo $embedding_csp_header; ?>"; ...
4 years, 2 months ago (2016-10-06 13:30:21 UTC) #31
amalika
https://codereview.chromium.org/2372563002/diff/220001/third_party/WebKit/Source/core/loader/FrameLoader.cpp File third_party/WebKit/Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/2372563002/diff/220001/third_party/WebKit/Source/core/loader/FrameLoader.cpp#newcode1633 third_party/WebKit/Source/core/loader/FrameLoader.cpp:1633: resourceRequest.setHTTPHeaderField(HTTPNames::Embedding_CSP, requiredCSP()); On 2016/10/06 at 08:00:51, Mike West wrote: ...
4 years, 2 months ago (2016-10-06 18:54:57 UTC) #34
Mike West
LGTM if you change the DCHECK to something that verifies that the value doesn't contain ...
4 years, 2 months ago (2016-10-07 12:11:59 UTC) #37
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/2372563002/300001
4 years, 2 months ago (2016-10-10 08:41:03 UTC) #43
commit-bot: I haz the power
Committed patchset #13 (id:300001)
4 years, 2 months ago (2016-10-10 09:54:46 UTC) #44
commit-bot: I haz the power
4 years, 2 months ago (2016-10-10 09:57:04 UTC) #46
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/ecf8bb9b85922dbed58632e269d579deb06ef58b
Cr-Commit-Position: refs/heads/master@{#424124}

Powered by Google App Engine
This is Rietveld 408576698