Commit e8ecfb59 authored by dgozman's avatar dgozman Committed by Commit bot

[DevTools] Whitelist remoteBase and loadNetworkResource schemes.

BUG=571121

Review URL: https://codereview.chromium.org/1586903002

Cr-Commit-Position: refs/heads/master@{#369327}
parent d7e370f5
...@@ -652,7 +652,10 @@ void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, ...@@ -652,7 +652,10 @@ void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback,
const std::string& headers, const std::string& headers,
int stream_id) { int stream_id) {
GURL gurl(url); 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; base::DictionaryValue response;
response.SetInteger("statusCode", 404); response.SetInteger("statusCode", 404);
callback.Run(&response); callback.Run(&response);
......
...@@ -1093,6 +1093,11 @@ Runtime.experiments = new Runtime.ExperimentsSupport(); ...@@ -1093,6 +1093,11 @@ Runtime.experiments = new Runtime.ExperimentsSupport();
* @type {?string} * @type {?string}
*/ */
Runtime._remoteBase = Runtime.queryParam("remoteBase"); Runtime._remoteBase = Runtime.queryParam("remoteBase");
{(function validateRemoteBase()
{
if (Runtime._remoteBase && !Runtime._remoteBase.startsWith("https://chrome-devtools-frontend.appspot.com/"))
Runtime._remoteBase = null;
})();}
/** /**
* @param {string} path * @param {string} path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment