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

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

Issue 2908433003: RenderFrameProxyHost::OnOpenURL needs to validate resource request body. (Closed)
Patch Set: Rebasing... Created 3 years, 7 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: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 92a8c11c374584ce03e144ac3417fb853aefba28..7e28d332730e878e86e9e13aa5603db59d315a56 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1238,6 +1238,12 @@ void RenderFrameHostImpl::OnFrameFocused() {
void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) {
GURL validated_url(params.url);
GetProcess()->FilterURL(false, &validated_url);
+ if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadRequestBody(
+ GetSiteInstance(), params.resource_request_body)) {
+ bad_message::ReceivedBadMessage(GetProcess(),
+ bad_message::RFH_ILLEGAL_UPLOAD_PARAMS);
+ return;
+ }
if (params.is_history_navigation_in_new_child) {
// Try to find a FrameNavigationEntry that matches this frame instead, based
« no previous file with comments | « content/browser/cross_site_transfer_browsertest.cc ('k') | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698