News for hackers. Stuff that matters.
Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @12:51PM (#23430613)
If you hash in the client, attackers with dumped hashed credentials (from elsewhere, which might only hash plaintext) don't need to try to reverse/"crack" the hashes, they can just use them as-is. With users reusing passwords across sites, that would be pretty terrible.
Re:WeChat permanently closes account after user sets offensi... by triou on Friday June 05, 2020 @01:11PM (#23430886)
That is why he said, we should do both: hashing client AND server side. Hashing on the client prevents sending plain text passwords to the server which could mishandle them eg. Logging them for instance like Twitter once did. Client side you can also check on registration if the user password is known to have been pwned (1password offers an api for that) and use a secure hashing algorithm. Server side the hash (which is then the password) will be salted and hashed again.
Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @02:30PM (#23432059)
That makes the hash of the user's password equivalent to a plain text password. And that means all those leaked databases, which previously only contained hashes that needed to be bruteforced to be reversed, suddenly function as a source of plaintexts.
Re:WeChat permanently closes account after user sets offensi... by evanreichard on Friday June 05, 2020 @03:59PM (#23433228)
I think (s)he is saying to hash client side, salt, then hash again server side. So if the database gets compromised, the attacker still has to apply the salt to brute force the hash.

I can't see a reason why this hurts, but it's probably not worth it. The only benefit I can see it having is if the user reuses their passwords on other sites, as now a potential malicious MITM would have to brute force the client side hashed password in order to reuse it on other sites. They would still be able to use that client side hashed PW to authenticate to the service in question, though.

Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @04:02PM (#23433275)
All the other websites where the users registered using the same email will only hash ONCE though!
Re:WeChat permanently closes account after user sets offensi... by evanreichard on Friday June 05, 2020 @04:24PM (#23433542)
Yeah, thats exactly my point. So the MITM who got the PW after client side hash, but before server side salt and hash would have to brute force that hash in order to use it on those other sites. That's the only benefit I see, and a very specific set of circumstances.
Re:WeChat permanently closes account after user sets offensi... by gpm on Saturday June 06, 2020 @07:39AM (#23438474)
Is it incredibly specific? I feel like that happens time and time again when companies accidently "mitm" themselves with logs or whatever.
Re:WeChat permanently closes account after user sets offensi... by l0b0 on Friday June 05, 2020 @04:17PM (#23433451)
The first sentence is true (and I can't believe how far down this thread it first appeared), but nobody was advocating abolishing server side hashing as well.

Basically, hashing on the client does absolutely nothing for the security of the transfer or storage of the password. Whatever the client passes to the server, whether it's hashed or not, is effectively their password, and intercepting that (again, whether hashed or not) would give an attacker the actual credentials of the user.

Re:WeChat permanently closes account after user sets offensi... by Dylan16807 on Friday June 05, 2020 @03:51PM (#23433130)
No. The database only contains the double hash. It still needs to be bruteforced.

There is zero downside to doing an extra hash, except the chance that someone codes such a basic thing wrong.

Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @04:03PM (#23433280)
No. Other websites on the internet, where the user also registered with the same email and password, contain the single hash.
Re:WeChat permanently closes account after user sets offensi... by Dylan16807 on Friday June 05, 2020 @04:18PM (#23433463)
Oh, I see. Other websites give you the 'password' to this website.

But only if neither site uses salt, so salt all your hashes. (Not even a salt is necessary here, just a site-wide addition would be fine. Or honestly you could just use a hash that wouldn't be used by a site too dumb to salt their database.)

Re:WeChat permanently closes account after user sets offensi... by arghwhat on Friday June 05, 2020 @01:34PM (#23431276)
No - As mentioned in a comment elsewhere, these kinds of experiments fall dangerously into a category of duct-tape crypto.

If you want secure password transfer, do not construct a ghetto solution with stacked hashes, but use a proper protocol like SRP (which, again, is pointless unless the client is trusted).

Especially in the case of Twitter, doing this provides absolutely nothing in respect to credential confidentiality as both sites of the transaction is written by Twitter.

Re:WeChat permanently closes account after user sets offensi... by mafuy on Friday June 05, 2020 @01:54PM (#23431584)
I don't get it. Assuming that a passivly listening attacker has broken TLS, additionally hashing at the client is helpful. The service at hand is now (most likely) insecure, but at least other services do not suffer from the plaintext password being exposed. It's an advantage, albeit small, but it's easy to do with virtually no risk of error.
Re:WeChat permanently closes account after user sets offensi... by arghwhat on Friday June 05, 2020 @05:06PM (#23433966)
Stacking hashes is not cryptographically sound. The additional hashing weakens the credentials. Cryptographic hashing is a very fragile subject.

"Assuming an attacker has broken TLS" - this makes no sense. If I had broken TLS, I could send you a login form with no hashing. I could modify your legitimate API requests, without the need for your credentials. I could take your token and forge requests as I wanted. All your assumptions go down the drain, as the security relied on the presence of TLS.

Basically, making this setup is generally harmful, while only providing negligible benefit in a doomsday scenario where all bets are off regardless.

If you truly want to have better security, you need an entirely different system. E.g., local private keys used to sign requests, or a proper password exchange/validation protocol. Smacking another hash on top does nothing good, and the idea is a good example of why normal people shouldn't crypto.

Re:WeChat permanently closes account after user sets offensi... by Jach on Friday June 05, 2020 @07:06PM (#23435026)
I've heard the "additional hashing weakens the credentials" line since I started programming, but no one ever bothers to link a citation, or if just reasoning simply from e.g. the pigeonhole principle seems to realize the increased likelihood of collisions is negligible for typical hash choices. It also flies in the face of common in-practice schemes (pre-bcrypt) like doing n rounds of sha256. There should be no real problem with doing the first round on the client.

I agree with you on the general pointlessness of client hashing, though, and oh what a world if we had pub-priv keys for authentication instead of passwords...

Re:WeChat permanently closes account after user sets offensi... by arghwhat on Saturday June 06, 2020 @06:00PM (#23442609)
> I've heard the "additional hashing weakens the credentials" line since I started programming, but no one ever bothers to link a citation

The main issue is that security analysis is non-trivial due to the interaction of their security guarantees. The end-result is effectively a new hashing algorithm. Figuring out the properties of this new algorithm requires a new cryptoanalysis (which is more than just avalanche tests).

> It also flies in the face of common in-practice schemes (pre-bcrypt) like doing n rounds of sha256. There should be no real problem with doing the first round on the client.

Old practices are deprecated for good reason, primarily due to flaws. Looking at what we used to do it not that useful.

The main problem is that it's not just "n rounds". The hash on the client must be salted, and it must be salted uniquely for that credential set, and must use a different salt from the backend hash. Plenty of ways to mess this up, and that's before we're even consider the implementation details of salting.

Then comes the interactions between likely different hashes. All in all, it's pretty complicated.

> I agree with you on the general pointlessness of client hashing, though, and oh what a world if we had pub-priv keys for authentication instead of passwords...

Especially with the only sensible procedure being password managers, it's silly we don't have asymmetric authentication. :(

Re:WeChat permanently closes account after user sets offensi... by mlaci on Saturday June 13, 2020 @06:04PM (#23513193)
> The additional hashing weakens the credentials.

If it's true, the attacker just has to do additional hashings to crack the password.

Re:WeChat permanently closes account after user sets offensi... by mafuy on Sunday June 07, 2020 @02:34AM (#23445267)
I'd like to highlight that "passively listening" was written intentionally. As soon as an attacker becomes active, he's at an incomparably higher risk of being detected.
Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @02:28PM (#23432029)
If TLS is broken, the world has bigger problems. And then they could simply intercept the session cookie either way.
Re:WeChat permanently closes account after user sets offensi... by ryukafalz on Friday June 05, 2020 @03:02PM (#23432467)
The session cookie isn’t a potentially reused human-readable string though. The password is.
Re:WeChat permanently closes account after user sets offensi... by arghwhat on Friday June 05, 2020 @05:09PM (#23434000)
If TLS was broken, I would always be able to get your password by just removing the hashing from the login page. I'd also be able to modify all legitimate requests, and be able to obtain your genuine login tokens for any site.
Re:WeChat permanently closes account after user sets offensi... by ryukafalz on Friday June 05, 2020 @05:42PM (#23434360)
That requires an active attack though. Yes, that’s always possible if TLS is broken, but it takes more work and is detectable. (Not saying it’s easy to detect, but it’s detectable in theory, where passive sniffing is not.)
Re:WeChat permanently closes account after user sets offensi... by arghwhat on Saturday June 06, 2020 @05:28PM (#23442375)
If TLS is broken, you lose all message authentication, rendering tampering entirely undetectable.

Passive sniffing requires the same attack vector, and the idea of an attacker only utilizing passive attacks makes no sense.

The point is that additional hashing designed for the premise of "broken TLS" fails the thread model test: It is pointless, as the only time it is applicable is when everything is fallen apart.

Re:WeChat permanently closes account after user sets offensi... by Dylan16807 on Friday June 05, 2020 @03:50PM (#23433101)
TLS itself doesn't have to be broken to have an interceptor.
Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @04:03PM (#23433286)
If your machine has TLS being intercepted nothing matters anymore. That would be the equivalent of having a keylogger installed. There's no point in trying to protect such a client anymore, it's game over then.
Re:WeChat permanently closes account after user sets offensi... by Dylan16807 on Friday June 05, 2020 @04:20PM (#23433495)
Passive interception happens. Especially when you're using a cipher that isn't forward-secure; a breach of the server could allow it to decrypt previous sessions.
Re:WeChat permanently closes account after user sets offensi... by devado on Friday June 05, 2020 @12:56PM (#23430686)
I think the idea is to hash on client _and_ the server. The client 1-way hash (~~unlike the server's 2-way~~) is the new "password" now and it's sole purpose is so that you don't get to see the raw password on the server.
Re:WeChat permanently closes account after user sets offensi... by ht85 on Friday June 05, 2020 @01:18PM (#23430986)
> server's 2-way

Are thinking of encoding / decoding? If so it isn't used for passwords.

Re:WeChat permanently closes account after user sets offensi... by devado on Friday June 05, 2020 @01:23PM (#23431078)
indeed, scratch that. i rewrote that comment a couple of times, and that 2-way part is of course not correct. this would defeat the point of hashing passwords if they were reversible
Re:WeChat permanently closes account after user sets offensi... by em-bee on Friday June 05, 2020 @02:58PM (#23432411)
notwithstanding all the other caveats mentioned here, wouldn't hashing on the client side make it possible to salt the hash so that different sites generate a different hash, thus making it unlikely that the hash can be reused even if the actual password is the same? the salt could even include a time component making the hash expire after a time.

this obviously does not eliminate the need for other security measures, so it's possibly more a question of "is it worth it?"

Re:WeChat permanently closes account after user sets offensi... by 0x0 on Friday June 05, 2020 @04:08PM (#23433338)
The server would need to hold the unsalted hash then. And if those leak, everything you need to calculate the client salt is right there.
Re:WeChat permanently closes account after user sets offensi... by labawi on Friday June 05, 2020 @04:35PM (#23433661)
The server should hold the unhashed salt, as is standard. One for client, one for server.