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

Unified Diff: content/browser/frame_host/render_frame_proxy_host.cc

Issue 1812723002: Add URL validation to navigations initiated via RenderFrameProxyHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie's nit Created 4 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
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_proxy_host.cc
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc
index 93dd48b64f559ba50d2a5e49bb036bfd6a804a05..4193ba0c3cf1050de07ed582cb49f12c96875d60 100644
--- a/content/browser/frame_host/render_frame_proxy_host.cc
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -248,6 +248,9 @@ void RenderFrameProxyHost::OnDetach() {
void RenderFrameProxyHost::OnOpenURL(
const FrameHostMsg_OpenURL_Params& params) {
+ GURL validated_url(params.url);
+ GetProcess()->FilterURL(false, &validated_url);
+
// Verify that we are in the same BrowsingInstance as the current
// RenderFrameHost.
RenderFrameHostImpl* current_rfh = frame_tree_node_->current_frame_host();
@@ -261,7 +264,7 @@ void RenderFrameProxyHost::OnOpenURL(
// TODO(alexmos, creis): Figure out whether |params.user_gesture| needs to be
// passed in as well.
frame_tree_node_->navigator()->RequestTransferURL(
- current_rfh, params.url, site_instance_.get(), std::vector<GURL>(),
+ current_rfh, validated_url, site_instance_.get(), std::vector<GURL>(),
params.referrer, ui::PAGE_TRANSITION_LINK, GlobalRequestID(),
params.should_replace_current_entry);
}
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698