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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2151323003: Add a check for mismatching URL and origin in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Format. Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 1ababbbe32c6b05884bfe936730cea01f86bd89b..0257039a662cf8a0b4703838420cfe32822bcb2c 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4772,6 +4772,13 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(
render_view_->SetZoomLevel(render_view_->page_zoom_level());
}
+ // Standard URLs must match the reported origin, when it is not unique.
+ if (params.url.IsStandard() && !params.origin.unique() &&
+ render_view_->GetWebkitPreferences().web_security_enabled) {
Charlie Reis 2016/07/15 20:33:17 Ah, good point. We'll need to skip the check for
nasko 2016/07/15 20:56:31 Such check added. However, all tests passed before
+ CHECK(params.origin.IsSameOriginWith(url::Origin(params.url)))
+ << " url:" << params.url << " origin:" << params.origin;
+ }
+
// This message needs to be sent before any of allowScripts(),
// allowImages(), allowPlugins() is called for the new page, so that when
// these functions send a ViewHostMsg_ContentBlocked message, it arrives
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698