Comment by aeonik

5 days ago

This is incorrect implementation fyi.

You are supposed to send the password, via TLS so it's not in the clear, to the server to be hashed.

If you hash on the client... then the hash essentially becomes the password, and defeats the purpose of a hash. I could just steal the hash and use it.

The name of this vulnerability is "pass the hash"

Hash the hash.

  • This would work, but the first stage hash is effectively the password at this point.

        Client:
            C = SHA256(password)
        
        Server:
            V = Argon2id(C, server_salt)
        
        Database:
            stores V and server_salt

    • Good I still don't want to know the password. If the first stage hash is compromised there are bigger issues, bigger than even if the database of hashes or passwords got hacked.