Page MenuHomePhabricator

SpecialUserlogin::onCookieRedirectCheck misses obscure case when using CentralAuth
Closed, ResolvedPublic

Description

Author: Bryan.TongMinh

Description:
When using CentralAuth SpecialUserlogin::onCookieRedirectCheck is useless:

  • Consider you login without an appropriate session cookie set
  • Your login succeeds and you get the appropriate UserId, UserName and session token
  • You are then redirected using wpCookieCheck which will trigger a check on your session cookie
  • Everything is ok so the UserLoginComplete will trigger
  • As there is no proper session attached, $wgUser will contain an anonymous user. CentralAuthHooks::onUserLoginComplete will run on that
  • CentralAuth will do undefined stuff and you will get the messsage 'You are now logged in to Meta as "83.81.x.y"'

Version: unspecified
Severity: normal

Details

Reference
bz14347

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:11 PM
bzimport set Reference to bz14347.

Bryan.TongMinh wrote:

Easy way to reproduce this behaviour:

  • Use FireFox and install the "View Cookies" add-on
  • Goto Special:Userlogin
  • Delete your session cookie
  • Login

The check works correctly for me for its primary purpose:

Tested in Safari 3.1.

Bryan.TongMinh wrote:

Yes, but not when you only clear your cookies after you've reached Special:Userlogin, but do not disable them. Should be extremely rare though.

  • Bug 14383 has been marked as a duplicate of this bug. ***

codemonk wrote:

This problem arises, if user has been browsing the web with cookies disabled, then he goes to login page, enables cookies, enters his password and... fails.