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 1107e77fe4508b99b5a2f3446bf766bf59c7ad7d..725492de62a2806e96b3234b355c3a9c45fc98cc 100644 |
--- a/content/browser/frame_host/render_frame_proxy_host.cc |
+++ b/content/browser/frame_host/render_frame_proxy_host.cc |
@@ -8,6 +8,7 @@ |
#include "base/lazy_instance.h" |
#include "content/browser/bad_message.h" |
+#include "content/browser/child_process_security_policy_impl.h" |
#include "content/browser/frame_host/cross_process_frame_connector.h" |
#include "content/browser/frame_host/frame_tree.h" |
#include "content/browser/frame_host/frame_tree_node.h" |
@@ -32,7 +33,8 @@ typedef base::hash_map<RenderFrameProxyHostID, RenderFrameProxyHost*> |
RoutingIDFrameProxyMap; |
base::LazyInstance<RoutingIDFrameProxyMap>::DestructorAtExit |
g_routing_id_frame_proxy_map = LAZY_INSTANCE_INITIALIZER; |
-} |
+ |
+} // namespace |
// static |
RenderFrameProxyHost* RenderFrameProxyHost::FromID(int process_id, |
@@ -250,6 +252,15 @@ void RenderFrameProxyHost::OnOpenURL( |
if (!site_instance_->IsRelatedSiteInstance(current_rfh->GetSiteInstance())) |
return; |
+ // Verify if the request originator (*not* |current_rfh|) has access to the |
+ // contents of the POST body. |
+ if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadRequestBody( |
+ GetSiteInstance(), params.resource_request_body)) { |
+ bad_message::ReceivedBadMessage(GetProcess(), |
+ bad_message::RFPH_ILLEGAL_UPLOAD_PARAMS); |
+ return; |
+ } |
+ |
// Since this navigation targeted a specific RenderFrameProxy, it should stay |
// in the current tab. |
DCHECK_EQ(WindowOpenDisposition::CURRENT_TAB, params.disposition); |