News for hackers. Stuff that matters.
Re:Authentication Cheat Sheet by beobab on Monday February 02, 2015 @10:57AM (#8984756)
"An application should respond with a generic error message regardless of whether the user ID or password was incorrect."

I really don't like this advice (although I see why they put it in there).

I often use different email addresses for different services so that I can determine who sells on email addresses (depending on how much I trust them), and quite often I can't remember which email address I signed up with (was that [email protected] or [email protected]).

At least if I see "user not recognised", I know to try a different email address.

Re:Authentication Cheat Sheet by danw3 on Monday February 02, 2015 @02:11PM (#8986116)
There was a decent article (I think it was on HN) a while ago that argued against this type of generic error message. The basic idea is that you can very easily discover whether the email is valid or not by attempting to create an account with that email (in most cases). It's trivially easy to either verify that the email you are trying to use is valid, or even build a database of valid email addresses to crack by attempting to create accounts. So why bother with generic error messages at all. It is not really buying you anything on the security end and it seems like it is sacrificing some usability.
Re:Authentication Cheat Sheet by aug-riedinger on Sunday February 08, 2015 @12:44PM (#9017847)
https://kev.inburke.com/kevin/invalid-username-or-password-u... Could not agree more on this. Best practice should evolve within time and wiki should be updated!
Re:Authentication Cheat Sheet by birdmanjeremy on Monday February 02, 2015 @11:14AM (#8984879)
Agreed. I actually just fought and won this battle at work. If you don't want to expose the specific error when logging in, you must either not leak usernames/emails through the signup process either. Otherwise, it's just security theater.
Re:Authentication Cheat Sheet by jfroma on Monday February 02, 2015 @11:53AM (#8985136)
Yes, and it is very hard to show a generic error during sign up.

"There is an error with your data..." WHAT ERROR? I've typed 10 fields.

I think a better approach is to rate limit wrong usernames / emails during sign in.

Re:Authentication Cheat Sheet by x1j7xJuzX on Monday February 02, 2015 @12:22PM (#8985307)
It's not a difficult problem to solve. Just let the sign-up succeed whether an account already exists for the email or not. Then say "You will receive an email with instructions to complete your registration".

If there was no existing account, send an email with the text: "An account was created for this email address at Example.com. If you requested this account, you may activate it by clicking here: https://..."

If there was an existing account, send: "An attempt was made to create a new account at Example.com for this email address, but you already have an account. If you have forgotten your password, visit https://..."

Re:Authentication Cheat Sheet by birdmanjeremy on Monday February 02, 2015 @02:06PM (#8986065)
Yes, this was the alternative we discussed. We opted to go with the simpler (and very common) signup process, which does admittedly leak some information.
Re:Authentication Cheat Sheet by jdbernard on Monday February 02, 2015 @01:19PM (#8985689)
That works for sign-up, but not for the far more common case of sign-in.
Re:Authentication Cheat Sheet by birdmanjeremy on Monday February 02, 2015 @02:07PM (#8986073)
If you use this approach, the idea is then that you use a generic login failure message. This prevents leaking of any account information, but provides a different (poorer, IMO) user experience.
Re:Authentication Cheat Sheet by birdmanjeremy on Monday February 02, 2015 @02:05PM (#8986050)
This is exactly the approach we took.
Re:Authentication Cheat Sheet by jessaustin on Monday February 02, 2015 @11:29AM (#8984988)
So just keep trying addresses until you get a reset link sent to you. It's really unacceptable for any service to leak its user list in the way you suggest.

EDIT: x1j7xJuzX in the sibling subthread has it right for email addresses. It's true that separate usernames would be difficult to handle in a user-friendly manner without leaking, but with a valid email address a separate username is probably unnecessary. It doesn't help the user interact with the site. If users interact with each other, they can just choose non-unique display names. To prevent impersonation, just use display name plus some other invariant account property to generate a hash that is displayed alongside the display name.

Re:Authentication Cheat Sheet by ryanatkn on Monday February 02, 2015 @11:48AM (#8985109)
Doesn't almost every service leak users at sign up? There are ways around it but I don't think they've very common.
Re:Authentication Cheat Sheet by oneeyedpigeon on Monday February 02, 2015 @11:54AM (#8985138)
How do you avoid 'leaking the user list' if you enforce unique usernames?
Re:Authentication Cheat Sheet by sanderjd on Monday February 02, 2015 @12:52PM (#8985506)
If you use email as username, you can make the sign up give the same "check your email to confirm your account" message for a new account and an existing account. This works well for new users and those who have already signed up but perhaps forgot, and leaks no information to someone who doesn't have access to that email account.

I'm not sure how to do this just for usernames, but usernames are less sensitive than emails anyway.

Re:Authentication Cheat Sheet by shogun21 on Monday February 02, 2015 @12:36PM (#8985408)
When registering for an account, duplicate usernames will flag a warning. This is enough to give hackers info whether or not a username exists.