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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2903123002: cros: Terminate if merge session fails for online sign-in (Closed)
Patch Set: add comments Created 3 years, 7 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/chromeos/login/signin/oauth2_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/session/user_session_manager.cc
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
index 598c694798e4635a12843bd8438e10552d6dfa95..607e9fa10a0bc70e0dd31f019e2fffda757bf6a7 100644
--- a/chrome/browser/chromeos/login/session/user_session_manager.cc
+++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -867,6 +867,20 @@ void UserSessionManager::OnSessionRestoreStateChanged(
login_manager->RemoveObserver(this);
+ // Terminate user session if merge session fails for an online sign-in.
+ // Otherwise, auth token dependent code would be in an invalid state.
+ // Important piece such as policy code might be broken because of this and
+ // subject to an exploit. See http://crbug.com/677312.
+ const bool is_online_signin =
+ user_context_.GetAuthFlow() == UserContext::AUTH_FLOW_GAIA_WITH_SAML ||
+ user_context_.GetAuthFlow() == UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML;
+ if (is_online_signin && state == OAuth2LoginManager::SESSION_RESTORE_FAILED) {
+ LOG(ERROR)
+ << "Session restore failed for online sign-in, terminating session.";
+ chrome::AttemptUserExit();
+ return;
+ }
+
if (exit_after_session_restore_ &&
(state == OAuth2LoginManager::SESSION_RESTORE_DONE ||
state == OAuth2LoginManager::SESSION_RESTORE_FAILED ||
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/signin/oauth2_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698