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

Unified Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 1586903002: [DevTools] Whitelist remoteBase and loadNetworkResource schemes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | third_party/WebKit/Source/devtools/front_end/Runtime.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_ui_bindings.cc
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc
index 7fddff1f0222ae2d6c4bbbbb0163dbcd8b038b7e..d86ecd9bb1da4ff7b3427035ef2396a6e6574fe7 100644
--- a/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -652,7 +652,10 @@ void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback,
const std::string& headers,
int stream_id) {
GURL gurl(url);
- if (!gurl.is_valid()) {
+ bool schemeIsAllowed = gurl.is_valid() &&
+ (gurl.SchemeIs(url::kHttpScheme) || gurl.SchemeIs(url::kHttpsScheme) ||
+ gurl.SchemeIs(url::kDataScheme) || gurl.SchemeIs(url::kFtpScheme));
+ if (!gurl.is_valid() || !schemeIsAllowed) {
base::DictionaryValue response;
response.SetInteger("statusCode", 404);
callback.Run(&response);
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/Runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698