3 ms·
#10, If the user guesses an invalid password, say why it’s invalid. Failed login should not say anything more than necessary. If the user enters a valid email
by cratermoon 5y ago
#10, If the user guesses an invalid password, say why it’s invalid.
Failed login should not say anything more than necessary. If the user enters a valid email and the wrong password, just say "invalid login". If you're going to display the password requirements, do so always, or don't do it at all.
The problem is that a malicious party could try usernames until they get "the password is incorrect for that user", and now they have a valid login. This is especially bad if the login is email, because now they have a valid email address to spam, and possibly phish the password.
Sometimes being too helpful is bad security. It's always a tradeoff, but something as simple as not giving away information protects both the user and the service way more than a bit of confusion.