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

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)

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

Description

PlzNavigate: Enforce 'form-action' CSP on the browser-side. Use a NavigationThrottle to enforce the 'form-action' CSP on the browser-side. Before this patch, this CSP wasn't checked on redirections. BUG=685074 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.linux:linux_chromium_browser_side_navigation_rel Review-Url: https://codereview.chromium.org/2689653003 Cr-Commit-Position: refs/heads/master@{#457966} Committed: https://chromium.googlesource.com/chromium/src/+/7cc34c583545597cffae27ad41bd015db6a93394

Patch Set 1 : PlzNavigate: Enforce 'form-action' CSP on the browser-side. #

Total comments: 20

Patch Set 2 : Addressed comments @mkwst #

Patch Set 3 : Add tests. #

Patch Set 4 : Rebase. #

Total comments: 29

Patch Set 5 : Rebase. #

Patch Set 6 : Addressed comments. #

Patch Set 7 : Rebase. #

Patch Set 8 : Disable renderer-side checks during a navigation. #

Patch Set 9 : Duplicate tests with a redirect. #

Total comments: 2

Patch Set 10 : Add TODO. #

Total comments: 45

Patch Set 11 : Rebase #

Patch Set 12 : Addressed comments @alexmos and @nasko. #

Patch Set 13 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+573 lines, -38 lines) Patch
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/form_submission_throttle.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -0 lines 0 comments Download
A content/browser/frame_host/form_submission_throttle.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +65 lines, -0 lines 0 comments Download
A content/browser/frame_host/form_submission_throttle_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +146 lines, -0 lines 0 comments Download
M content/browser/frame_host/interstitial_page_navigator_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -6 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +12 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +21 lines, -8 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M content/browser/frame_host/navigation_request.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -1 line 0 comments Download
M content/browser/frame_host/navigator_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -4 lines 0 comments Download
M content/browser/loader/navigation_url_loader_unittest.cc View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/common/navigation_params.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M content/common/navigation_params.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -2 lines 0 comments Download
M content/public/browser/navigation_handle.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M content/public/test/navigation_simulator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 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 12 2 chunks +6 lines, -1 line 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
A content/test/data/form_submission_throttle/form_action_none.html View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A content/test/data/form_submission_throttle/form_action_with_path.html View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
A content/test/data/form_submission_throttle/no_csp.html View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -4 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-allowed-with-redirect.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +34 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-allowed-with-redirect-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-default-ignored.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-default-ignored-with-redirect.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +34 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-default-ignored-with-redirect-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-allowed-with-redirect.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +34 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-allowed-with-redirect-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-with-redirect.html View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-with-redirect-expected.txt 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/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 145 (114 generated)
arthursonzogni
Hi Camille and Mike. Please could you take a look at this patch? Thanks! clamy: ...
3 years, 10 months ago (2017-02-22 14:05:59 UTC) #56
Mike West
The general shape here looks reasonable. A few questions about the throttle, and I'd like ...
3 years, 10 months ago (2017-02-22 15:36:08 UTC) #57
arthursonzogni
Thanks Mike, Some answers below: https://codereview.chromium.org/2689653003/diff/180001/content/browser/frame_host/form_submission_throttle.cc File content/browser/frame_host/form_submission_throttle.cc (right): https://codereview.chromium.org/2689653003/diff/180001/content/browser/frame_host/form_submission_throttle.cc#newcode53 content/browser/frame_host/form_submission_throttle.cc:53: return NavigationThrottle::PROCEED; On 2017/02/22 ...
3 years, 10 months ago (2017-02-22 17:15:24 UTC) #58
arthursonzogni
https://codereview.chromium.org/2689653003/diff/180001/content/browser/frame_host/form_submission_throttle.cc File content/browser/frame_host/form_submission_throttle.cc (right): https://codereview.chromium.org/2689653003/diff/180001/content/browser/frame_host/form_submission_throttle.cc#newcode53 content/browser/frame_host/form_submission_throttle.cc:53: return NavigationThrottle::PROCEED; On 2017/02/22 17:15:23, arthursonzogni wrote: > On ...
3 years, 10 months ago (2017-02-23 13:28:53 UTC) #61
nasko
Hey Alex, Can you help review this CL as mkwst@ seems to be out this ...
3 years, 9 months ago (2017-02-27 18:41:08 UTC) #73
alexmos
Overall looks good, some minor comments below. I tried to pitch in on some of ...
3 years, 9 months ago (2017-02-28 02:48:47 UTC) #74
Mike West
I'm back! But I'm mostly out again tomorrow! Hooray for kindergarten closures! The general shape ...
3 years, 9 months ago (2017-03-02 10:45:34 UTC) #75
arthursonzogni
Thanks for the reviews. Some answers below. I still need to write a test about ...
3 years, 9 months ago (2017-03-07 16:25:52 UTC) #76
nasko
Just couple of drive-by comments. https://codereview.chromium.org/2689653003/diff/180001/content/browser/frame_host/form_submission_throttle.h File content/browser/frame_host/form_submission_throttle.h (right): https://codereview.chromium.org/2689653003/diff/180001/content/browser/frame_host/form_submission_throttle.h#newcode19 content/browser/frame_host/form_submission_throttle.h:19: class CONTENT_EXPORT FormSubmissionThrottle : ...
3 years, 9 months ago (2017-03-09 05:35:17 UTC) #83
Mike West
Sorry for the delayed response, I'm buried (as are we all this week, right?). I ...
3 years, 9 months ago (2017-03-09 08:20:04 UTC) #84
arthursonzogni
Hi Mike, Here is the set of tests I was talking about yesterday. It shows ...
3 years, 9 months ago (2017-03-09 13:07:38 UTC) #85
arthursonzogni
Oops, sorry for the previous message, I though I was in https://codereview.chromium.org/2737343004 So yes, there ...
3 years, 9 months ago (2017-03-09 13:13:02 UTC) #86
arthursonzogni
On 2017/03/09 13:13:02, arthursonzogni wrote: > Oops, sorry for the previous message, I though I ...
3 years, 9 months ago (2017-03-09 18:43:28 UTC) #87
arthursonzogni
https://codereview.chromium.org/2689653003/diff/290001/content/browser/frame_host/form_submission_throttle.h File content/browser/frame_host/form_submission_throttle.h (right): https://codereview.chromium.org/2689653003/diff/290001/content/browser/frame_host/form_submission_throttle.h#newcode18 content/browser/frame_host/form_submission_throttle.h:18: // blocking requests which violate them. On 2017/03/09 08:20:04, ...
3 years, 9 months ago (2017-03-10 09:35:37 UTC) #88
Mike West
On 2017/03/10 at 09:35:37, arthursonzogni wrote: > I tried, every layout tests are working with ...
3 years, 9 months ago (2017-03-10 14:04:20 UTC) #89
Mike West
The patch looks pretty reasonable at this point. Can you rebase it so we can ...
3 years, 9 months ago (2017-03-10 14:06:00 UTC) #90
arthursonzogni
On 2017/03/10 14:04:20, Mike West (Slow.) wrote: > On 2017/03/10 at 09:35:37, arthursonzogni wrote: > ...
3 years, 9 months ago (2017-03-13 13:49:58 UTC) #91
arthursonzogni
Hi, thanks for the reviews! I have tried to understand what is the current behavior ...
3 years, 9 months ago (2017-03-14 12:41:45 UTC) #102
arthursonzogni
On 2017/03/14 12:41:45, arthursonzogni wrote: > Hi, thanks for the reviews! > > I have ...
3 years, 9 months ago (2017-03-14 15:28:22 UTC) #110
Mike West
On 2017/03/14 at 12:41:45, arthursonzogni wrote: > I will not be able to remove entirely ...
3 years, 9 months ago (2017-03-14 15:43:27 UTC) #112
Mike West
https://codereview.chromium.org/2689653003/diff/410001/third_party/WebKit/Source/core/loader/FrameLoader.cpp File third_party/WebKit/Source/core/loader/FrameLoader.cpp (right): https://codereview.chromium.org/2689653003/diff/410001/third_party/WebKit/Source/core/loader/FrameLoader.cpp#newcode1671 third_party/WebKit/Source/core/loader/FrameLoader.cpp:1671: !browserSideNavigationEnabled && I'm fine with leaving this in, as ...
3 years, 9 months ago (2017-03-14 15:45:39 UTC) #113
arthursonzogni
Thank you very much! I will wait the depending patches to be committed. I will ...
3 years, 9 months ago (2017-03-15 13:15:10 UTC) #118
nasko
I'll defer to alexmos@ for the final approval of CSP behavior, I just did a ...
3 years, 9 months ago (2017-03-16 21:49:47 UTC) #119
alexmos
LGTM with nits. Looks like all the followup work has bugs filed, and the rest ...
3 years, 9 months ago (2017-03-16 23:05:36 UTC) #120
arthursonzogni
Thanks for the reviews! Next step for me is to store the is_form_submission somewhere such ...
3 years, 9 months ago (2017-03-17 14:58:25 UTC) #122
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/2689653003/490001
3 years, 9 months ago (2017-03-18 03:10:32 UTC) #133
commit-bot: I haz the power
Failed to apply patch for content/browser/frame_host/render_frame_host_impl.cc: While running git apply --index -p1; error: patch failed: ...
3 years, 9 months ago (2017-03-18 06:04:04 UTC) #135
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/2689653003/490001
3 years, 9 months ago (2017-03-18 06:10:50 UTC) #137
commit-bot: I haz the power
Failed to apply patch for content/browser/frame_host/render_frame_host_impl.cc: While running git apply --index -p1; error: patch failed: ...
3 years, 9 months ago (2017-03-18 06:16:08 UTC) #139
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/2689653003/510001
3 years, 9 months ago (2017-03-18 06:26:53 UTC) #142
commit-bot: I haz the power
3 years, 9 months ago (2017-03-18 09:01:43 UTC) #145
Message was sent while issue was closed.
Committed patchset #13 (id:510001) as
https://chromium.googlesource.com/chromium/src/+/7cc34c583545597cffae27ad41bd...

Powered by Google App Engine
This is Rietveld 408576698