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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFormElement.cpp

Issue 2487973004: Enforce form-action CSP even when form.target is present. (Closed)
Patch Set: Created 4 years, 1 month 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/html/HTMLFormElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
index dd75c5daae1fbcb830b111b104382efebc578db8..4fbbaa02e4de6bc20b086f4304dec31d4d93fa8c 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -409,10 +409,12 @@ void HTMLFormElement::scheduleFormSubmission(FormSubmission* submission) {
return;
}
+ if (!document().contentSecurityPolicy()->allowFormAction(
+ submission->action())) {
+ return;
+ }
+
if (protocolIsJavaScript(submission->action())) {
- if (!document().contentSecurityPolicy()->allowFormAction(
- submission->action()))
- return;
document().frame()->script().executeScriptIfJavaScriptURL(
submission->action());
return;
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/1.1/form-action-src-get-blocked-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698