Live data from Hacker News

“Username or password is incorrect” is bullshit

hackernoon.com

81–90 of 170 posts

Re: “Username or password is incorrect” is bullshit

#81

I have an argument for "username or password is incorrect" messages: it's possible that the password is correct, username exists but isn't the intended one. Then "password is incorrect" message would be lying, as the issue is actually with a username.

So passwords might be forced to be unique across users? I've read about that before:

https://thedailywtf.com/articles/Really_Unique_Passwords

Re: “Username or password is incorrect” is bullshit

#82
post #52

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 poi…

> 2. Email and password for registration. On registration send confirmation email. This opens up a different problem. It should be: 2. Email only for tentative registration. On tentative registration, send confirmation email. 3. User clicks link in confirmation email, which takes to page for setting password. (Alternatively, confirmation email includes randomly generated initial password, user is required to change i…

I feel like my job is to never trust anyone. Don't trust their string encodings, the characters they put into those strings, the arrangements of the characters we do allow, etc.

Re: “Username or password is incorrect” is bullshit

#83
After reading this I went straight to change the login system I'm currently working on ... And discover that I would need to add some extra code paths / conditionals ... So for me it's not "best practice", it's more todo with laziness and not wanting to add complexity to critical functions.

Re: “Username or password is incorrect” is bullshit

#84
post #66

Ask HN: Why does Amazon allow multiple accounts with the same email address? (2014) | https://news.ycombinator.com/item?id=7075372

Interesting. Just reading this now, but it makes me wonder, what happens if you set two accounts to the same password?

> you can create two accounts with the same e-mail address, but you will get into trouble if you try and give them the same password. I'm not sure what happens, so try it and see.

Re: “Username or password is incorrect” is bullshit

#85
post #71

The right answer isn't a blanket "sites should do this super-secret e-mail-only shuffle and not tell you anything". First, you should define your threat model: which information is considered secret and which isn't, and treat any violations as security vulnerabilities. If usernames are public by design, then don't hide them in one form, and expose in URLs elsewhere on the site. If exposing who's registered on your si…

default to privacy though, please

Re: “Username or password is incorrect” is bullshit

#86
post #56

Earlier quoted context omitted.

You mean you log onto John with password 12345 and the website says "Some other user uses this password, but not John"? Seems wrong, somehow.

More like, I log in as john with password 12345, but I forgot that I had to sign up as john87, so the password is correct and saying it isn't is misleading (even though the system doesn't know that for a fact, it is a possibility).

But how would the system know you're supposed to log in as john87? It would have to check your password against ALL passwords (which shouldn't be technically possible in the first place, because passwords should be hashed and salted, and the only way to check if they are valid should be in context of the given user - as gregoriol noticed).

Re: “Username or password is incorrect” is bullshit

#87
post #56

Earlier quoted context omitted.

You mean you log onto John with password 12345 and the website says "Some other user uses this password, but not John"? Seems wrong, somehow.

If you, as a developer, are technically able to check that the password is used by another user, you have failed pretty big at best practices.

Yeah, that too :)

Re: “Username or password is incorrect” is bullshit

#88
post #68

Earlier quoted context omitted.

If the username is used as the salt when storing the hashed password in the database, it's unpossible to know if a supplied password is valid-but-for-a-different-account.

Wow, using the user as the salt is awesome. Is this considered an ok security practice?

Nah, user logins/emails often won't be long enough or random enough. See https://security.stackexchange.com/a/8024/28881 and https://stackoverflow.com/a/5565071/2521092

Re: “Username or password is incorrect” is bullshit

#89
post #63

Not quite on topic, but it would be nice if more websites would offer the option of using client side TLS certificate "login" with or without an additional prompt for a username and password. It would be next to impossible for an attacker to bypass that. For example, even if the attacker provided the correct credentials, they most likely would not have the associated client-side TLS certificate private key. Then the…

Sounds like a great solution - would browsers need to support it? Do you have any resources on implementing it?

Already supported by browsers. Massive PITA to use. The old Startcom SSL webapp was an example.

Private keys and certs aren't as portable as passwords. Backing them up, copying them to another device, etc. lacks good UI.

Re: “Username or password is incorrect” is bullshit

#90
post #68

Earlier quoted context omitted.

If the username is used as the salt when storing the hashed password in the database, it's unpossible to know if a supplied password is valid-but-for-a-different-account.

Wow, using the user as the salt is awesome. Is this considered an ok security practice?

Why would anyone use that ? Best practices require that every user has a random (probablistically) unique salt. Just use bcrypt, or other password hash functions.
Post reply on HN