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

Unified Diff: chrome/browser/extensions/extension_bookmarks_module.cc

Issue 6879047: Make sure that extensions can launch web urls, create bookmark url with web safe schemes only. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 8 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 | chrome/common/extensions/extension.cc » ('j') | chrome/common/extensions/extension.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_bookmarks_module.cc
===================================================================
--- chrome/browser/extensions/extension_bookmarks_module.cc (revision 81909)
+++ chrome/browser/extensions/extension_bookmarks_module.cc (working copy)
@@ -31,6 +31,7 @@
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
+#include "content/browser/child_process_security_policy.h"
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -468,8 +469,13 @@
json->GetString(keys::kTitleKey, &title); // Optional.
std::string url_string;
json->GetString(keys::kUrlKey, &url_string); // Optional.
+
+ // Ensure the bookmark URL is a valid URL and has a web safe scheme.
GURL url(url_string);
- if (!url.is_empty() && !url.is_valid()) {
+ ChildProcessSecurityPolicy *policy =
+ ChildProcessSecurityPolicy::GetInstance();
+ if (!url.is_empty() &&
+ (!url.is_valid() || !policy->IsWebSafeScheme(url.scheme()))) {
error_ = keys::kInvalidUrlError;
return false;
}
« no previous file with comments | « no previous file | chrome/common/extensions/extension.cc » ('j') | chrome/common/extensions/extension.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698