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

Issue 2488743003: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)

Created:
4 years, 1 month ago by arthursonzogni
Modified:
4 years ago
CC:
apavlov+blink_chromium.org, blink-reviews, blink-reviews-dom_chromium.org, caseq+blink_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, jam, Nate Chapin, kozyatinskiy+blink_chromium.org, loading-reviews_chromium.org, lushnikov+blink_chromium.org, mmenke, nasko+codewatch_chromium.org, nasko, pfeldman+blink_chromium.org, Randy Smith (Not in Mondays), rwlbuis, sof, tyoshino+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

(Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. This patch moves ancestor-based blocking behavior up from Blink into the browser, which gives us some correctness assurances we can't match in the renderer (for top-level plugins, etc), and ensures that a (malicious?) renderer isn't responsible for policing itself. This is a re-land of https://codereview.chromium.org/1617043002, after clamy@'s heroic refactoring effort to process 'Content-Disposition' and similar download-triggering mechanisms before handing things off to this new throttle. BUG=555418 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation,linux_chromium_browser_side_navigation_rel Committed: https://crrev.com/c5a2f126d6e96ef139e4211ff225169b810490f4 Cr-Commit-Position: refs/heads/master@{#440055}

Patch Set 1 : Apply patch (CL=2321503002) #

Patch Set 2 : Handle BLOCK_RESPONSE on NavigationRequest + quickfix. #

Patch Set 3 : Update filter (DevTools is not supported yet). #

Patch Set 4 : Rebase. #

Patch Set 5 : Display a blank page instead of an error page. ( and add checks in NavigationRequest) #

Total comments: 10

Patch Set 6 : Addressed comments (@alexmos) #

Patch Set 7 : Rebase #

Total comments: 9

Patch Set 8 : Addressed comments (@clamy). #

Total comments: 17

Patch Set 9 : Addressed comments (@clamy #2) #

Patch Set 10 : Add histogram. #

Total comments: 10

Patch Set 11 : Rebase #

Patch Set 12 : Addressed comments (@clamy #3) #

Total comments: 8

Patch Set 13 : Addressed comments (@alexmos #2) #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+706 lines, -186 lines) Patch
M components/error_page/common/localized_error.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A content/browser/frame_host/ancestor_throttle.h View 1 2 3 4 5 6 7 8 10 11 1 chunk +64 lines, -0 lines 0 comments Download
A content/browser/frame_host/ancestor_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +264 lines, -0 lines 1 comment Download
A content/browser/frame_host/ancestor_throttle_unittest.cc View 1 chunk +183 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +14 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_handle_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +38 lines, -1 line 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +15 lines, -4 lines 0 comments Download
M content/browser/loader/navigation_resource_throttle.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -0 lines 0 comments Download
M content/public/browser/navigation_throttle.h View 2 chunks +7 lines, -1 line 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +12 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -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 3 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/network/x-frame-options-deny.html View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/inspector/network/x-frame-options-deny-expected.txt View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-invalid-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-conflict-expected.txt View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/XFrameOptions/x-frame-options-none-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentInit.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/frame/UseCounter.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorInstrumentationCustomInl.h View 1 chunk +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 6 7 8 9 10 5 chunks +13 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.h View 1 2 3 4 5 6 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -66 lines 0 comments Download
M third_party/WebKit/Source/core/loader/HttpEquiv.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPParsers.h View 1 2 3 4 5 6 2 chunks +0 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/platform/network/HTTPParsers.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -29 lines 0 comments Download
M third_party/WebKit/Source/platform/network/ResourceError.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +39 lines, -0 lines 0 comments Download

Messages

Total messages: 92 (72 generated)
arthursonzogni
Hi, I would like to continue the efforts of @mkwst on: https://codereview.chromium.org/2321503002/ I added 3 ...
4 years ago (2016-11-23 17:38:51 UTC) #21
alexmos
This seems reasonable to me. Loading a blank page will let us land this without ...
4 years ago (2016-11-30 01:22:19 UTC) #22
arthursonzogni
Thanks! I agreed with your suggestions. @mkwst: please see the comments below. https://codereview.chromium.org/2488743003/diff/120001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc ...
4 years ago (2016-11-30 13:49:55 UTC) #26
clamy
Thanks! I'm mostly happy with the navigation code, some comments below. Note that I haven't ...
4 years ago (2016-12-06 17:09:44 UTC) #54
arthursonzogni
Thanks @clamy! @mkwst: Are you happy with the change? https://codereview.chromium.org/2488743003/diff/240001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2488743003/diff/240001/content/browser/frame_host/navigation_handle_impl.cc#newcode294 content/browser/frame_host/navigation_handle_impl.cc:294: ...
4 years ago (2016-12-07 16:25:02 UTC) #56
Mike West
Merging the state of the enum seems reasonable to me. The //third_party/WebKit and `AncestorThrottle` bits ...
4 years ago (2016-12-08 09:19:42 UTC) #57
clamy
Thanks! A few more comments now that I have gone through the AncestorThrottle itself. https://codereview.chromium.org/2488743003/diff/280001/components/error_page/common/localized_error.cc ...
4 years ago (2016-12-09 17:14:02 UTC) #59
Mike West
On 2016/12/09 at 17:14:02, clamy wrote: > https://codereview.chromium.org/2488743003/diff/280001/content/browser/frame_host/ancestor_throttle.cc#newcode65 > content/browser/frame_host/ancestor_throttle.cc:65: handle->frame_tree_node()->frame_tree()->root()->current_origin(); > @mkwst: sanity check. ...
4 years ago (2016-12-13 13:59:33 UTC) #61
arthursonzogni
Thanks Camille! There were counters on the renderer-side that are no more incremented. Thus, I ...
4 years ago (2016-12-13 15:32:13 UTC) #64
clamy
Thanks! A few more comments. https://codereview.chromium.org/2488743003/diff/280001/content/browser/frame_host/ancestor_throttle.cc File content/browser/frame_host/ancestor_throttle.cc (right): https://codereview.chromium.org/2488743003/diff/280001/content/browser/frame_host/ancestor_throttle.cc#newcode33 content/browser/frame_host/ancestor_throttle.cc:33: AncestorThrottle::AncestorThrottle(NavigationHandle* handle) Actually you ...
4 years ago (2016-12-16 15:21:43 UTC) #65
arthursonzogni
Thanks! I agreed with all you comments. Currently, there is one and only one value ...
4 years ago (2016-12-19 12:01:19 UTC) #68
alexmos
I took another quick look at this before disappearing for the holidays, and this LGTM ...
4 years ago (2016-12-20 01:34:39 UTC) #71
arthursonzogni
Thanks @alexmos! https://codereview.chromium.org/2488743003/diff/420001/content/browser/frame_host/ancestor_throttle.cc File content/browser/frame_host/ancestor_throttle.cc (right): https://codereview.chromium.org/2488743003/diff/420001/content/browser/frame_host/ancestor_throttle.cc#newcode35 content/browser/frame_host/ancestor_throttle.cc:35: // X-Frame-Options: SAMEORIGIN. The navigation proceeds and ...
4 years ago (2016-12-20 10:29:43 UTC) #75
clamy
Thanks! Lgtm. https://codereview.chromium.org/2488743003/diff/500001/content/browser/frame_host/ancestor_throttle.cc File content/browser/frame_host/ancestor_throttle.cc (right): https://codereview.chromium.org/2488743003/diff/500001/content/browser/frame_host/ancestor_throttle.cc#newcode53 content/browser/frame_host/ancestor_throttle.cc:53: // The frame sets multiple 'X-Frame-Options' header ...
4 years ago (2016-12-20 14:27:01 UTC) #76
arthursonzogni
Hi @edwardjung, Please could you take a look at: components/error_page/common/localized_error.cc It adds a new error ...
4 years ago (2016-12-20 16:02:11 UTC) #78
edwardjung
localized_error.cc lgtm
4 years ago (2016-12-20 16:17:58 UTC) #79
arthursonzogni
On 2016/12/20 16:17:58, edwardjung wrote: > localized_error.cc lgtm Thanks!
4 years ago (2016-12-20 16:35:13 UTC) #80
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/2488743003/500001
4 years ago (2016-12-21 08:42:02 UTC) #87
commit-bot: I haz the power
Committed patchset #13 (id:500001)
4 years ago (2016-12-21 08:47:52 UTC) #90
commit-bot: I haz the power
4 years ago (2016-12-21 08:50:29 UTC) #92
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/c5a2f126d6e96ef139e4211ff225169b810490f4
Cr-Commit-Position: refs/heads/master@{#440055}

Powered by Google App Engine
This is Rietveld 408576698