Hashing a second time on the server protects from a database leak being used to access the site.
Hashing a second time on the server protects from a database leak being used to access the site.
No it doesn't, because all of those attackers have access to the client side salt which is sent to the client in the clear.
Now, depending on the hashing algorithm, maybe it's easy to turn that back into the plaintext, but with a competent hash, it's not expected to be easy.
Edit to add, if the site does it in javascript, of course they (or intermediaries) could decide not to do it, or to also pass the plaintext with the hashed version. That's a separate issue.
The dictionary attack on the client created hash and the attack on the server hash of the plaintext take the same effort.
In the first case, there's a 100% chance of the password being compromised, but in the second an attacker has to spend resources on cracking a password, and there's still a small chance that they're unable to crack it. The second case seems like a clear winner (I could still be missing something).
So sure, you may have prevented the release of a reused password, but you haven't prevented anyone from impersonating your user on your site.
Depending on how they have access to your plaintext conversation, they could get your reused password from another site.
In other words, while this might make a slight difference in the stealing of reused passwords, it's not really worth the effort. There are far better solutions, like encouraging the use of a password manager.
That is the whole point. In this system the hash generated on the client is literally your password. It's just to provide some extra protection for people who reuse passwords that are compromised on the server or over the wire.
>There are far better solutions, like encouraging the use of a password manager.
That might be better but your solution requires telling billions of people to not reuse passwords and use a password manager. Or you could implement this on your site and your users are instantly better off. Real users are better off if we just make their behavior safer.
That's not a realistic use case if you use https on your site.
The effort in implementing this, testing it, testing fallbacks when Javascript is unavailable, testing every change with the fallback on and off, and so on, just isn't worth it for that absolutely tiny gain.
This measure is to limit the blast radius of a compromised password given that people reuse passwords.
All you've done is move your attack from the server to the client. It's the same attack on both ends.
If the password is so weak that you can just invert the hash then there's not much that can help you.
Why would you send it in the clear?