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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 7873007: Restricting redirects to chrome: (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 89a0ef9a6be470fcab0fa81314e4dde0f8aca376..0d7d125d3b99101d20b40448308dc1e142a23d1d 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -1006,6 +1006,11 @@ bool URLRequestHttpJob::IsSafeRedirect(const GURL& location) {
// restrict redirects to externally handled protocols. Our consumer would
// need to take care of those.
+ // This is a special case: we need to disallow redirects to chrome://
+ // URIs by network resources for security reasons
+ if (location.SchemeIs("chrome"))
abarth-chromium 2011/09/12 19:51:21 The net module shouldn't really know anything abou
kenrb 2011/09/12 20:05:05 I know. This is a hack at this point, but the alte
+ return false;
+
if (!URLRequest::IsHandledURL(location))
abarth-chromium 2011/09/12 19:51:21 Do we think that "chrome" is a handled URL?
kenrb 2011/09/12 20:05:05 Note the ! in the condition. It is not a handled U
rvargas (doing something else) 2011/09/12 21:07:14 I don't think hard coding "chrome:" is a good idea
kenrb 2011/09/13 00:27:53 Sorry, my mistake. I was confusing this with a lis
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698