Last modified: 2014-10-30 23:53:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72098, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70098 - Unable to login and reset password: "Invalid hash given" in all cases
Unable to login and reset password: "Invalid hash given" in all cases
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
wmf-deployment
All All
: High major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-27 19:07 UTC by Sergei S. Rublev
Modified: 2014-10-30 23:53 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Unable to login and reset password: "Invalid hash given" in all cases (59.43 KB, image/jpeg)
2014-08-27 19:07 UTC, Sergei S. Rublev
Details

Description Sergei S. Rublev 2014-08-27 19:07:41 UTC
Created attachment 16294 [details]
Unable to login and reset password: "Invalid hash given" in all cases

Greetings!

User Yustas is having trouble with login and password reset. He hasn't been logging in for a while. Now, he tries to login, but can't. He has email entered: yustas@yustas.com. He tries to reset password and successfully receives reset email. But when he enters old and new passwords, he sees permanent "Invalid hash given" message (I have attached the screenshot received from him). He tried several browsers and OSes. 

Please help him. You can contact him directly at the email given, or at talk page at Commons https://commons.wikimedia.org/wiki/User_talk:Yustas
Comment 1 Sam Reed (reedy) 2014-08-27 19:36:09 UTC
Which Wiki is he using?

I note he seems to have a :A: password on commonswiki, but on enwiki user_password is unprefixed, but user_newpassword is :B: prefixed..
Comment 2 Sergei S. Rublev 2014-08-27 19:37:41 UTC
The main goal now is to login to Commons. He says he remembers he was activating SUL...
Comment 3 Sergei S. Rublev 2014-08-27 19:51:34 UTC
Not completely sure about SUL though. He says years ago he was creating same-username account on several wikis.

He says: on commonswiki, enwiki and ruwiki: if he types wrong password, he gets message about wrong password. When he types correct password, the reset procedure is started.
Comment 4 Sergei S. Rublev 2014-08-27 19:55:57 UTC
He says there is no email confirmation when he tyes correct password. He immediately gets dialog presented at screenshot.
Comment 5 Chris Steipp 2014-08-27 20:32:54 UTC
Well something is definitely wrong... Yustas'es password is :A: type, but has a salt stored with it. That shouldn't ever happen.

The password api patch did a trick to pretend un-prefixed hashes were type :A:, even if password salting was used, so the hash would get upgraded to type :B:. I'm guessing something in there messed it up.

I'm testing a couple solutions. I think we'll be able to either blank the password and let them use password reset. Or it may be a valid :B: hash, and so we can just change the type. I'm working on a reproduction so I can test it.
Comment 6 Chris Steipp 2014-08-27 20:35:02 UTC
(In reply to Sergei S. Rublev from comment #3)
> Not completely sure about SUL though. He says years ago he was creating
> same-username account on several wikis.
> 
> He says: on commonswiki, enwiki and ruwiki: if he types wrong password, he
> gets message about wrong password. When he types correct password, the reset
> procedure is started.

Yeah, we have a hook doing that, since their on the list of users who's password hashes were leaked. We could remove the username from our hook too, to simplify that bit.
Comment 7 Sergei S. Rublev 2014-08-27 20:38:53 UTC
Well, we're not able to properly understand some of the technical terms. Can you please give us some simple instructions on what to do, if needed?
Comment 8 Chris Steipp 2014-08-27 20:48:07 UTC
(In reply to Chris Steipp from comment #6)
> Yeah, we have a hook doing that, since their on the list of users who's
> password hashes were leaked. We could remove the username from our hook too,
> to simplify that bit.

Ok, I marked that username as having already reset their password, so they shouldn't get the reset form on login. Should be able to login now.
Comment 9 Sergei S. Rublev 2014-08-27 20:55:54 UTC
Got it! He says he has successfully logged in first on commons, then on several wikis.

Thank you very much!
Comment 10 Chris Steipp 2014-08-27 21:53:23 UTC
For the actual issue, I managed to reproduce the effect that caused the problem. A user with type :A: password with a hard expired password, I logged in several times and in one case, the password was updated to :A::<hash>, and I couldn't login. I'm not able to find a reliable reproduction for ending up in that state though.

I'm a little suspicious of https://github.com/wikimedia/mediawiki-core/blob/2f491ef504b0489afd8a85d6a145058c29c46e61/includes/User.php#L1230 vs. checking $wgPasswordSalt like in https://github.com/wikimedia/mediawiki-core/blob/2f491ef504b0489afd8a85d6a145058c29c46e61/includes/User.php#L4655

Adding Tyler in case he has ideas.
Comment 11 Kevin Israel (PleaseStand) 2014-10-27 07:56:51 UTC
(In reply to Chris Steipp from comment #10)
> [...] the password was updated to
> :A::<hash>, and I couldn't login.

I think I753c135a would fix that problem. We may need a DB cleanup script and/or the compatibility hack I thought we didn't need.

> [...] I'm not able to find a reliable
> reproduction for ending up in that state though.

Perhaps the user had tried to reset his password by email before attempting to log in with his existing password? That would cause $user->saveSettings() to be called, which to get the string to store in the DB, would call toString() on the MWOldPassword object. Though why would we have :A: hashes in the DB at all?
Comment 12 Chris Steipp 2014-10-30 23:53:32 UTC
I think we fixed the general issue, and the specific user is in, so I'm going to close this. Reopen if anything else is needed.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links