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

Unified Diff: chrome/browser/resources/gaia_auth/main.js

Issue 888173002: cros: Restrict gaiaURL to be http and https only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix blank line Created 5 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 | chrome/browser/resources/gaia_auth/util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/gaia_auth/main.js
diff --git a/chrome/browser/resources/gaia_auth/main.js b/chrome/browser/resources/gaia_auth/main.js
index cf0d43d6b5a091272d624772b3c34e31d3c447a4..914bed5748e937bab677567b467362107d3c81fd 100644
--- a/chrome/browser/resources/gaia_auth/main.js
+++ b/chrome/browser/resources/gaia_auth/main.js
@@ -82,6 +82,14 @@ Authenticator.prototype = {
var params = getUrlSearchParams(location.search);
this.parentPage_ = params.parentPage || this.PARENT_PAGE;
this.gaiaUrl_ = params.gaiaUrl || this.GAIA_URL;
+
+ // Sanitize Gaia url before continuing.
+ var scheme = extractProtocol(this.gaiaUrl_);
+ if (scheme != 'https:' && scheme != 'http:') {
+ console.error('Bad Gaia URL, url=' + this.gaiaURL_);
+ return;
+ }
+
this.gaiaPath_ = params.gaiaPath || this.GAIA_PAGE_PATH;
this.inputLang_ = params.hl;
this.inputEmail_ = params.email;
« no previous file with comments | « no previous file | chrome/browser/resources/gaia_auth/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698