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

Unified Diff: chrome/common/extensions/extension.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 | « chrome/browser/extensions/extension_bookmarks_module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 81909)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -20,8 +20,6 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "base/version.h"
-#include "crypto/sha2.h"
-#include "crypto/third_party/nss/blapi.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
@@ -35,6 +33,9 @@
#include "chrome/common/extensions/file_browser_handler.h"
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/url_constants.h"
+#include "content/browser/child_process_security_policy.h"
+#include "crypto/sha2.h"
+#include "crypto/third_party/nss/blapi.h"
#include "googleurl/src/url_util.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -1209,8 +1210,11 @@
return false;
}
- // Ensure the launch URL is a valid absolute URL.
- if (!GURL(launch_url).is_valid()) {
+ // Ensure the launch URL is a valid absolute URL and has a web safe scheme.
+ GURL url(launch_url);
+ ChildProcessSecurityPolicy *policy =
+ ChildProcessSecurityPolicy::GetInstance();
+ if (!url.is_valid() || !policy->IsWebSafeScheme(url.scheme())) {
Aaron Boodman 2011/04/19 18:29:33 I think it would be better to use Extension::kVali
*error = errors::kInvalidLaunchWebURL;
return false;
}
« no previous file with comments | « chrome/browser/extensions/extension_bookmarks_module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698