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

Issue 2022083002: Move 'frame-src' CSP checks into FrameFetchContext. (Closed)

Created:
4 years, 6 months ago by Mike West
Modified:
4 years, 6 months ago
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, mkwst+watchlist-csp_chromium.org, Nathan Parker, site-isolation-reviews_chromium.org, tyoshino+watch_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move 'frame-src' CSP checks into FrameFetchContext. Currently, we're doing 'frame-src' checks inside 'FrameLoader', which ends up being too early in the navigation cycle to handle the results of 'upgrade-insecure-requests'. Happily, we've refactored enough of the loading code in the last ~3 years that we can pretty easily move this check into 'FrameFetchContext::canRequest' alongside the rest of CSP. BUG=615910 Committed: https://crrev.com/3f3e725e6479c711e5e13e59e8d011ee89992119 Cr-Commit-Position: refs/heads/master@{#398685}

Patch Set 1 : --no-find-copies #

Total comments: 8

Patch Set 2 : Rebase+Content+Sandbox #

Total comments: 2

Patch Set 3 : yoav #

Total comments: 14

Patch Set 4 : Nits. #

Patch Set 5 : redirects #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -57 lines) Patch
M content/browser/site_per_process_browsertest.cc View 1 2 3 5 chunks +15 lines, -16 lines 1 comment Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/iframe-upgrade-csp.https.html View 1 chunk +46 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 4 3 chunks +16 lines, -4 lines 2 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 2 chunks +33 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 4 chunks +6 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/web/tests/data/iframe_redirect_blocked.html View 1 2 3 4 1 chunk +13 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 54 (16 generated)
Mike West
WDYT, Jochen?
4 years, 6 months ago (2016-05-31 14:18:44 UTC) #2
Mike West
https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt File third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt (right): https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt#newcode8 third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/frame-src-child-frame-navigates-to-blocked-origin-expected.txt:8: This is the only behavioral change: if we navigate ...
4 years, 6 months ago (2016-05-31 14:25:29 UTC) #4
Yoav Weiss
Drive-by nit and question :) https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode529 third_party/WebKit/Source/core/loader/FrameFetchContext.cpp:529: // If we're loading ...
4 years, 6 months ago (2016-05-31 14:37:15 UTC) #6
Mike West
creis@, nasko@: There are some content browsertest failures that I don't have enough context to ...
4 years, 6 months ago (2016-06-01 06:53:30 UTC) #8
jochen (gone - plz use gerrit)
+dcheng who might remember this very issue https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode531 third_party/WebKit/Source/core/loader/FrameFetchContext.cpp:531: if (Frame* ...
4 years, 6 months ago (2016-06-01 15:16:37 UTC) #10
Charlie Reis
On 2016/06/01 06:53:30, Mike West (OOO until 30th) wrote: > creis@, nasko@: There are some ...
4 years, 6 months ago (2016-06-01 19:47:32 UTC) #12
Charlie Reis
On 2016/06/01 19:47:32, Charlie Reis wrote: > On 2016/06/01 06:53:30, Mike West (OOO until 30th) ...
4 years, 6 months ago (2016-06-01 20:40:37 UTC) #13
Charlie Reis
On 2016/06/01 20:40:37, Charlie Reis wrote: > On 2016/06/01 19:47:32, Charlie Reis wrote: > > ...
4 years, 6 months ago (2016-06-01 20:47:56 UTC) #14
Charlie Reis
On 2016/06/01 20:40:37, Charlie Reis wrote: > I'll post a link to the bug and ...
4 years, 6 months ago (2016-06-01 22:14:05 UTC) #15
alexmos
On 2016/06/01 19:47:32, Charlie Reis wrote: > On 2016/06/01 06:53:30, Mike West (OOO until 30th) ...
4 years, 6 months ago (2016-06-01 22:21:02 UTC) #17
alexmos
https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2022083002/diff/20001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode534 third_party/WebKit/Source/core/loader/FrameFetchContext.cpp:534: frame()->loader().forceSandboxFlags(SandboxOrigin); On 2016/06/01 22:21:02, alexmos wrote: > Why use ...
4 years, 6 months ago (2016-06-01 22:22:07 UTC) #18
Mike West
Thanks folks! I've taken another stab at the blink-side implementation, and fixed up the //content-side ...
4 years, 6 months ago (2016-06-02 08:58:02 UTC) #19
Yoav Weiss
https://codereview.chromium.org/2022083002/diff/40001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2022083002/diff/40001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode530 third_party/WebKit/Source/core/loader/FrameFetchContext.cpp:530: if (!csp && type == Resource::MainResource) { I understand ...
4 years, 6 months ago (2016-06-02 09:15:15 UTC) #20
Mike West
Fixed the remaining broken tests; WDYT, yoav@, alexmos@, et al? https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode517 ...
4 years, 6 months ago (2016-06-02 13:39:30 UTC) #21
Yoav Weiss
core/ LGTM % a question https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp File third_party/WebKit/Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp#newcode639 third_party/WebKit/Source/core/loader/DocumentLoader.cpp:639: loadUnique(); What's the reason ...
4 years, 6 months ago (2016-06-02 14:13:38 UTC) #22
Mike West
https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp File third_party/WebKit/Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp#newcode639 third_party/WebKit/Source/core/loader/DocumentLoader.cpp:639: loadUnique(); On 2016/06/02 at 14:13:37, Yoav Weiss wrote: > ...
4 years, 6 months ago (2016-06-02 14:25:45 UTC) #23
Yoav Weiss
https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp File third_party/WebKit/Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp#newcode639 third_party/WebKit/Source/core/loader/DocumentLoader.cpp:639: loadUnique(); On 2016/06/02 14:25:45, Mike West (OOO until 30th) ...
4 years, 6 months ago (2016-06-02 14:28:07 UTC) #24
Charlie Reis
On 2016/06/01 20:47:56, Charlie Reis wrote: > One concern for your change that I noticed ...
4 years, 6 months ago (2016-06-02 16:48:19 UTC) #25
Mike West
On 2016/06/02 at 16:48:19, creis wrote: > On 2016/06/01 20:47:56, Charlie Reis wrote: > > ...
4 years, 6 months ago (2016-06-02 17:03:43 UTC) #26
Charlie Reis
On 2016/06/02 17:03:43, Mike West (OOO until 30th) wrote: > On 2016/06/02 at 16:48:19, creis ...
4 years, 6 months ago (2016-06-02 17:22:12 UTC) #27
dcheng
https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp File third_party/WebKit/Source/core/loader/FrameFetchContext.cpp (right): https://codereview.chromium.org/2022083002/diff/60001/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp#newcode577 third_party/WebKit/Source/core/loader/FrameFetchContext.cpp:577: if (Frame* parentFrame = frame()->tree().parent()) { How does CSP ...
4 years, 6 months ago (2016-06-02 21:48:56 UTC) #28
alexmos
Great, I like the loadUnique() approach much better than tinkering with sandbox flags, so that ...
4 years, 6 months ago (2016-06-02 22:21:07 UTC) #29
Mike West
creis@, alexmos@: Would y'all mind taking a look at the changes to WebFrameTest and DocumentLoader ...
4 years, 6 months ago (2016-06-06 08:40:10 UTC) #30
Charlie Reis
[+japhet] On 2016/06/06 08:40:10, Mike West (OOO until 30th) wrote: > creis@, alexmos@: Would y'all ...
4 years, 6 months ago (2016-06-06 20:43:07 UTC) #32
Mike West
On 2016/06/06 at 20:43:07, creis wrote: > On 2016/06/06 08:40:10, Mike West (OOO until 30th) ...
4 years, 6 months ago (2016-06-07 08:08:42 UTC) #34
Charlie Reis
On 2016/06/07 08:08:42, Mike West (OOO until 30th) wrote: > On 2016/06/06 at 20:43:07, creis ...
4 years, 6 months ago (2016-06-07 22:22:34 UTC) #35
Charlie Reis
[-nathanr, +nparker] Looks like there was a typo in the reviewer list. Nathan, can you ...
4 years, 6 months ago (2016-06-07 22:24:24 UTC) #38
Nathan Parker
+jialiul for Charlie's request
4 years, 6 months ago (2016-06-08 15:55:33 UTC) #39
Nathan Parker
4 years, 6 months ago (2016-06-08 15:56:07 UTC) #41
Jialiu Lin
On 2016/06/07 at 08:08:42, mkwst wrote: > On 2016/06/06 at 20:43:07, creis wrote: > > ...
4 years, 6 months ago (2016-06-08 18:23:14 UTC) #42
Jialiu Lin
lgtm
4 years, 6 months ago (2016-06-08 18:23:48 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2022083002/100001
4 years, 6 months ago (2016-06-08 18:39:09 UTC) #46
Mike West
On 2016/06/08 at 18:23:14, jialiul wrote: > On 2016/06/07 at 08:08:42, mkwst wrote: > > ...
4 years, 6 months ago (2016-06-08 18:45:02 UTC) #47
Mike West
On 2016/06/08 at 18:45:02, Mike West (OOO until 30th) wrote: > On 2016/06/08 at 18:23:14, ...
4 years, 6 months ago (2016-06-08 18:59:39 UTC) #48
Jialiu Lin
On 2016/06/08 at 18:59:39, mkwst wrote: > On 2016/06/08 at 18:45:02, Mike West (OOO until ...
4 years, 6 months ago (2016-06-08 19:14:05 UTC) #49
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 6 months ago (2016-06-08 21:35:04 UTC) #51
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/3f3e725e6479c711e5e13e59e8d011ee89992119 Cr-Commit-Position: refs/heads/master@{#398685}
4 years, 6 months ago (2016-06-08 21:37:40 UTC) #53
tommycli
4 years, 6 months ago (2016-06-13 18:13:03 UTC) #54
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:100001) has been created in
https://codereview.chromium.org/2068443002/ by tommycli@chromium.org.

The reason for reverting is: Speculative revert for breaking Dr. Memory:

https://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Content%2...

First breaking build:

https://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Content%2....

Powered by Google App Engine
This is Rietveld 408576698