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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 817103002: Only take basename of default_file_name when starting a File Chooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change to filter at the IPC Created 6 years 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/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 12dded9c853882da9d9a61a14a3864691aaa0d57..a21ae696a30e647f38b7cab0b265e52c9e22d475 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -1445,6 +1445,14 @@ void RenderViewHostImpl::OnDidZoomURL(double zoom_level,
}
void RenderViewHostImpl::OnRunFileChooser(const FileChooserParams& params) {
+ // Do not allow messages with absolute paths in them as this can permit a
+ // renderer to coerce the browser to perform I/O on a renderer controlled
+ // path.
+ if (params.default_file_name.IsAbsolute()) {
Lei Zhang 2015/01/05 22:43:55 Should we check and make sure the file name does n
+ GetProcess()->ReceivedBadMessage();
+ return;
+ }
+
delegate_->RunFileChooser(this, params);
}
« no previous file with comments | « no previous file | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698