Live data from Hacker News

“Username or password is incorrect” is bullshit

hackernoon.com

11–20 of 170 posts

Re: “Username or password is incorrect” is bullshit

#11
post #10
post #4

Even if this doesn’t increase security, you should still do it in the hope the user will check the username they’ve just typed as well as retyping the password.

Why? Why not just tell the user what is actually wrong?

Because the application doesn't know what is actually wrong. The error message is actually correct as written. The user entered their username incorrectly or their password incorrectly, or both. The application doesn’t know which and shouldn’t guess!

Re: “Username or password is incorrect” is bullshit

#12
post #10
post #4

Even if this doesn’t increase security, you should still do it in the hope the user will check the username they’ve just typed as well as retyping the password.

Why? Why not just tell the user what is actually wrong?

Because this prompts them to check the username again, instead of trying to enter their password again while they typo'd the username (but hit a valid account with their typo)?

Re: “Username or password is incorrect” is bullshit

#13
post #11
post #10

Earlier quoted context omitted.

Why? Why not just tell the user what is actually wrong?

Because the application doesn't know what is actually wrong. The error message is actually correct as written. The user entered their username incorrectly or their password incorrectly, or both. The application doesn’t know which and shouldn’t guess!

Why wouldn't the application know?

Re: “Username or password is incorrect” is bullshit

#14
post #10
post #4

Even if this doesn’t increase security, you should still do it in the hope the user will check the username they’ve just typed as well as retyping the password.

Why? Why not just tell the user what is actually wrong?

Because it allows attackers to look for accounts. It's part of your privacy that I shouldn't be able to see if you have an account with sexycatpictures.com

Not accusing you BTW.

Re: “Username or password is incorrect” is bullshit

#15

The article explains how to do it properly at the end: > To prevent attackers from knowing whether an account exists or not your signup must only take an email address and provide no feedback in the UI if the sign up succeeded or not. Instead the user would receive an email saying they’re signed up. Is this not also part of the various 'best practices'? (I confess I don't read too many of them!)

Typically, yes. This post didn't really offer any new insight to this. Maybe it's a PSA? Either way, it completely depends on the site's threat model. In the case of GitHub, it's quite useless because a user can just go to the targets's profile to see if it exists. Thus, it really isn't in GitHub's threat model, obviously.

Where it gets really interesting is when you perform user enumeration attacks via timing. IE: it takes the server a few milliseconds longer to send a registration email than to not, or it takes the server longer to try to validate a password hash than to lookup a nonexistent user.

Re: “Username or password is incorrect” is bullshit

#16
post #10
post #4

Even if this doesn’t increase security, you should still do it in the hope the user will check the username they’ve just typed as well as retyping the password.

Why? Why not just tell the user what is actually wrong?

Assume a site has two accounts "user122" and "user123". When a user logs in with "user122" and a password and it does not work: What happened? Did the user mistype the password or the username?

Re: “Username or password is incorrect” is bullshit

#17
The solution is relatively simple.

1. Email and password for login. Don't tell the attacker which is correct.

2. Email and password for registration. On registration send confirmation email. If user is already register attacker would need access to their email. Access to email is game over.

So now an attacker can't see which users are registered with your service and you've protected your customers privacy.

Extra points if your code is aware of timing attacks.

Re: “Username or password is incorrect” is bullshit

#18
post #11

Earlier quoted context omitted.

Because the application doesn't know what is actually wrong. The error message is actually correct as written. The user entered their username incorrectly or their password incorrectly, or both. The application doesn’t know which and shouldn’t guess!

Why wouldn't the application know?

The application doesn't know if the username you entered is actually yours or someone else's.

You could provide the correct password to your account 'test', but not 'ttest'.

The server just tells you to check both instead, it's more semantically correct and offers some security improvements with user enumeration.

Re: “Username or password is incorrect” is bullshit

#19
post #11

Earlier quoted context omitted.

Because the application doesn't know what is actually wrong. The error message is actually correct as written. The user entered their username incorrectly or their password incorrectly, or both. The application doesn’t know which and shouldn’t guess!

Why wouldn't the application know?

The application knows unless it some app written by someone who is starting with programming.

Re: “Username or password is incorrect” is bullshit

#20
post #10

Earlier quoted context omitted.

Why? Why not just tell the user what is actually wrong?

Because it allows attackers to look for accounts. It's part of your privacy that I shouldn't be able to see if you have an account with sexycatpictures.com Not accusing you BTW.

Read the article. It's debunking that exact argument.
Post reply on HN