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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2689653003: PlzNavigate: Enforce 'form-action' CSP on the browser-side. (Closed)
Patch Set: Rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index f5b8cec3ad254910ff5fef0ad3b96457ccc92fef..13857db271a9005fbcfd277261654baa7bd4495b 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1693,6 +1693,16 @@ NavigationPolicy FrameLoader::shouldContinueForNavigationPolicy(
bool isFormSubmission = type == NavigationTypeFormSubmitted ||
type == NavigationTypeFormResubmitted;
if (isFormSubmission &&
+ // 'form-action' check in the frame that is navigating is disabled on the
+ // renderer side when PlzNavigate is enabled, but is enforced on the
+ // browser side instead.
+ // N.B. check in the frame that initiates the navigation stills occurs in
+ // blink and is not enforced on the browser-side.
+ // TODO(arthursonzogni) The 'form-action' check should be fully disabled
+ // in blink when browser side navigation is enabled, except when the form
+ // submission doesn't trigger a navigation(i.e. javascript urls). Please
+ // see https://crbug.com/701749
+ !browserSideNavigationEnabled &&
!m_frame->document()->contentSecurityPolicy()->allowFormAction(
request.url(), request.redirectStatus())) {
return NavigationPolicyIgnore;
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-with-redirect-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698