4 ms·
Doesn't sending the salt to the client void a whole layer of security?
by ricardobeat 9y ago
Doesn't sending the salt to the client void a whole layer of security?
- eropple 9y agoI don't see how that'd be the case. An attacker who has visibility into the client that has the salt can already see the plaintext password. And an attacker on the service side of things can see the salt anyway, it's in the database.
- jedisct1 9y agoAn attacker that would have the ability to impersonate the server could precompute a rainbow table for a given salt, and send that salt to the client. OTOH, without client-side prehashing, an attacker that has the ability to impersonate the server doesn't have to precompute anything in order to collect all passwords.
- Franciscouzo 9y agoIf an attacker is able to impersonate the server, then it is also able to ask the client for the password by modifying the Javascript sent.
- jedisct1 9y agoAll clients are not web browsers, but sure.
- Buge 9y ago>An attacker who has visibility into the client that has the salt can already see the plaintext password. There is no way for the server to distinguish a legitimate user trying to login from an attacker trying to hack someone. So if the salt is sent to a legitimate client, the salt will also be sent to attackers. I'm not sure if sending the salt to attackers is really a vulnerability though.
- jedisct1 9y agoCertainly not, especially if it is sent over an authenticated channel.
- dchest 9y agoSince getting the salt must be possible by supplying only username, one security disadvantage of such scheme is that by getting the salt of the target the attacker can precompute password guesses and store them. When the password verifier database leaks, the attacker then can more quickly verify guesses. This is a really tiny advantage and may even be more expensive than non-precomputed attack due to storage, so it doesn't matter in the real world. Another disadvantage is that if changing password also changes salt, by requesting salt over the period of time, the attacker can learn when the password was changed.
- jedisct1 9y agoMore details about one way to implement this, covering how to deal with nonexistent users: https://download.libsodium.org/doc/password_hashing/#server-relief https://download.libsodium.org/doc/password_hashing/#server-...
- xnyhps 9y agoI'm still wondering how to deal with password changes in that scheme. If you change the salt, you reveal the existence of that account and the fact that the password changed. But keeping the salt the same seems unsafe as well...
- SAI_Peregrinus 9y agoNo, the salt is not a secret value. It's just unique per entry.