News for hackers. Stuff that matters.
Re:Steam's login method is kinda interesting by netsharc on Monday January 11, 2021 @11:05AM (#25730755)
Yahoo! Mail also does (maybe "did", I looked at it a decade ago) something similar. When the user opens the login page, s/he gets a random string in one of the hidden form fields, IIRC it hashes the user-entered password, and then adds the random string and hashes it again, and sends this result to the backend.

On the backend, it knows the random string it sent to the user, and it has the hashed password in its DB, so it can do the same algorithm and compare the results.

Re:Steam's login method is kinda interesting by k1t on Monday January 11, 2021 @11:26AM (#25731145)
The danger with that approach is that the hashed password has become the password. If the hashes are leaked, they can be used to login.
Re:Steam's login method is kinda interesting by lostcolony on Monday January 11, 2021 @12:17PM (#25732106)
Yeah; I've seen this done elsewhere and facepalmed.

Actually, I've seen this done -worse- elsewhere, where they were actually encrypting the password, using a symmetric key. So if you sniffed the traffic and never loaded the website, I guess, you'd not know the actual password...but you wouldn't need it; it as as good as for the purposes of logging in. If you did load the website, you could still determine what the plaintext password was.

It was really irritating, since I had to figure out what the encryption scheme of a backend app was doing (when I only had access to the frontend code, and the datastore).

Re:Steam's login method is kinda interesting by lostmsu on Monday January 11, 2021 @11:36AM (#25731336)
That only works if the string is the same each time. But it won't, if it changes like TOTP code.
Re:Steam's login method is kinda interesting by k1t on Monday January 11, 2021 @11:59AM (#25731755)
If all you are comparing is HASH(random_string + hashed_password) then it will still work.

The server will give me random_string and I know hashed_password from the DB leak.

Obviously this assumes the login process actually works as described in the earlier post.

Re:Steam's login method is kinda interesting by lostmsu on Monday January 11, 2021 @02:06PM (#25734422)
That protects hashes from leaking in transit, for the scenario with 3rd party TLS terminators mentioned above.
Re:Steam's login method is kinda interesting by jarkhen on Monday January 11, 2021 @11:46AM (#25731517)
If the string changes each time, how could they possibly have the matching hashed password stored in the database?
Re:Steam's login method is kinda interesting by fgonzag on Monday January 11, 2021 @11:59AM (#25731750)
They have the users password hash stored in their db so they can replicate the process server side:

login_token = hash(pwd_hash + nonce)

its nothing too wild, especially considering the age of yahoo mail.

Re:Steam's login method is kinda interesting by jarkhen on Monday January 11, 2021 @12:10PM (#25731962)
Ah, right, I misread the original description of what they were doing.

As is, then, it really is just making the hashed password the new password. If I can get the hashed password out of the DB, I can load the login page and simply skip the initial hashing step that's done on the frontend. I now have access to the account without ever knowing the original password.

Re:Steam's login method is kinda interesting by SAI_Peregrinus on Monday January 11, 2021 @01:32PM (#25733555)
Except that it's easy (indeed, required for security) to change the nonce for each login request, so you can't just replay the hash.
Re:Steam's login method is kinda interesting by jarkhen on Monday January 11, 2021 @02:00PM (#25734295)
That protects against an attacker reading network traffic. It does not protect against an attacker that has the hashed password from the DB.

The only thing you need in order to authenticate at any given time is the hash of (hashed password + nonce). The latter you get for free, at any time, from the server, so you only need to know the hashed password -- not the password itself. Since the hashed password is directly stored in the DB, if you get your hands on that you can authenticate.

Re:Steam's login method is kinda interesting by SAI_Peregrinus on Tuesday January 12, 2021 @09:51AM (#25747617)
Right. My mistake. I should have thought it through more thoroughly before posting. Hopefully my comment doesn't mislead anyone, I'll try to do better in the future.
Re:Steam's login method is kinda interesting by lxgr on Monday January 11, 2021 @12:46PM (#25732661)
Coincidentally, that is exactly what MS-CHAPv2 does if memory serves me right.