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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 246533006: Block renderer-initiated navigation to other chrome URLs on signin page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/browser/ui/webui/signin/inline_login_ui_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 18dd4c317acea99346143bccf39206e1b75a18cc..635a59ce479d20aa601d709df3dffcc0d0b6ffbf 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1150,6 +1150,17 @@ bool ChromeContentBrowserClient::ShouldAllowOpenURL(
extension, url.path()))
return false;
}
+
+ // Do not allow chrome://chrome-signin navigate to other chrome:// URLs, since
+ // the signin page may host untrusted web content.
+ if (from_url.GetOrigin().spec() == chrome::kChromeUIChromeSigninURL &&
+ url.SchemeIs(content::kChromeUIScheme) &&
+ url.host() != chrome::kChromeUIChromeSigninHost) {
+ VLOG(1) << "Blocked navigation to " << url.spec() << " from "
+ << chrome::kChromeUIChromeSigninURL;
+ return false;
+ }
+
return true;
}
« no previous file with comments | « no previous file | chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698