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

Issue 2910573002: Implement upgrade-insecure-requests in browser for frame requests (Closed)

Created:
3 years, 7 months ago by estark
Modified:
3 years, 6 months ago
Reviewers:
clamy, Mike West, nasko
CC:
blink-reviews, blink-reviews-frames_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, nasko+codewatch_chromium.org, arthursonzogni
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement upgrade-insecure-requests in browser for frame requests In PlzNavigate, frame requests currently have most of their CSP checks done in the browser process. But upgrade-insecure-requests was still applied in Blink, meaning that upgraded frame requests couldn't be properly reported. This CL moves upgrading into the browser process for frame requests, and properly splits up CSP checks per spec: (1) evaluate report-only CSPs, (2) upgrade request if needed, (3) evaluate enforced CSPs. There are other cases for which we might need to do something similar which are not handled by this CL: namely form submissions and same-host main-frame navigations. Also note that I'm not attempting to apply upgrade-insecure-requests when following redirects. UIR in general does not work when following redirects, and that's a much larger issue outside the scope of this CL. (https://crbug.com/615885) This is a follow-up to https://codereview.chromium.org/2909513002/, and is the browser-process version of https://codereview.chromium.org/2790693002. BUG=713388 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2910573002 Cr-Commit-Position: refs/heads/master@{#478478} Committed: https://chromium.googlesource.com/chromium/src/+/4bb7f5d6743f3ae5a69f1624c6e3547ba4f234ee

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : rebase #

Patch Set 4 : rebase, fix unit tests #

Patch Set 5 : blink::WebString constructor #

Patch Set 6 : rebase #

Patch Set 7 : rebase #

Patch Set 8 : add unit tests, don't even try on redirects #

Patch Set 9 : fix BuildPolicy argument #

Total comments: 4

Patch Set 10 : mkwst comment #

Patch Set 11 : update test expectations #

Total comments: 6

Patch Set 12 : update original_url, add test for it #

Patch Set 13 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+293 lines, -33 lines) Patch
M content/browser/frame_host/form_submission_throttle.cc View 1 chunk +5 lines, -1 line 0 comments Download
M content/browser/frame_host/mixed_content_navigation_throttle.h View 1 chunk +0 lines, -4 lines 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +35 lines, -1 line 0 comments Download
M content/common/content_security_policy/content_security_policy.h View 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/content_security_policy/content_security_policy.cc View 2 chunks +11 lines, -0 lines 0 comments Download
M content/common/content_security_policy/content_security_policy_unittest.cc View 1 2 3 4 5 6 7 1 chunk +16 lines, -0 lines 0 comments Download
M content/common/content_security_policy/csp_context.h View 2 chunks +21 lines, -1 line 0 comments Download
M content/common/content_security_policy/csp_context.cc View 2 chunks +46 lines, -3 lines 0 comments Download
M content/common/content_security_policy/csp_context_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +106 lines, -13 lines 0 comments Download
M content/common/content_security_policy/csp_directive.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/common/content_security_policy/csp_directive.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/upgrade-insecure-requests-reporting.https.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +32 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 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 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 3 chunks +6 lines, -6 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 68 (54 generated)
estark
This CL has some unit tests, but its main test is a web-platform-test that I ...
3 years, 6 months ago (2017-05-29 20:56:53 UTC) #37
Mike West
On 2017/05/29 at 20:56:53, estark wrote: > This CL has some unit tests, but its ...
3 years, 6 months ago (2017-05-30 07:36:23 UTC) #38
Mike West
https://codereview.chromium.org/2910573002/diff/150001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp File third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp (right): https://codereview.chromium.org/2910573002/diff/150001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp#newcode1402 third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp:1402: blink::WebString("upgrade-insecure-requests"), Can you add this directive to the method's ...
3 years, 6 months ago (2017-05-30 07:36:31 UTC) #39
estark
Thanks Mike! Nasko, this is #2/2 for upgrade-insecure-requests reporting with PlzNavigate (follow-up to https://codereview.chromium.org/2909513002/) https://codereview.chromium.org/2910573002/diff/150001/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp ...
3 years, 6 months ago (2017-06-01 04:18:30 UTC) #43
nasko
Adding clamy@ here too, as this is a follow up to the other CL.
3 years, 6 months ago (2017-06-01 05:26:54 UTC) #47
estark
Yeah -- I mentioned in the other cl, upgrade-insecure-requests in general doesn't work on redirects ...
3 years, 6 months ago (2017-06-01 05:53:41 UTC) #48
estark
Yeah -- I mentioned in the other cl, upgrade-insecure-requests in general doesn't work on redirects ...
3 years, 6 months ago (2017-06-01 05:53:41 UTC) #49
nasko
Reviewed only content/browser/frame_host/. Let me know if my review is needed elsewhere. Overall looks good, ...
3 years, 6 months ago (2017-06-05 21:31:49 UTC) #50
estark
I added a test and ran into an additional exciting issue that we need to ...
3 years, 6 months ago (2017-06-06 19:16:15 UTC) #55
nasko
On 2017/06/06 19:16:15, estark (slow thru Jun8) wrote: > > I added a test for ...
3 years, 6 months ago (2017-06-08 14:51:19 UTC) #60
clamy
On 2017/06/08 14:51:19, nasko (slow) wrote: > On 2017/06/06 19:16:15, estark (slow thru Jun8) wrote: ...
3 years, 6 months ago (2017-06-09 14:43:20 UTC) #61
nasko
content/browser/frame_host/ LGTM
3 years, 6 months ago (2017-06-09 22:25:41 UTC) #62
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/2910573002/230001
3 years, 6 months ago (2017-06-09 22:55:56 UTC) #65
commit-bot: I haz the power
3 years, 6 months ago (2017-06-10 00:46:24 UTC) #68
Message was sent while issue was closed.
Committed patchset #13 (id:230001) as
https://chromium.googlesource.com/chromium/src/+/4bb7f5d6743f3ae5a69f1624c6e3...

Powered by Google App Engine
This is Rietveld 408576698