by tptacek · 10y ago · 0 comments
He's right: don't ask for security questions from your users. Security questions are ridiculous.
He's wrong about making password reset optional. In 10+ years of consulting at Matasano I can't think of a single application for which users could sign up directly that didn't have password reset. You're asking for a support nightmare by making it optional --- worse, you're putting your engineering team in a position where they can be socially engineered into changing passwords, and this is an attack vector that actually does get used in the wild.
The password reset scheme here is, I think, overcomplicated. If you generate a long random token and associate it with the user's account, there's no significant risk of timing attacks (I'd go a step farther and suggest there probably isn't a realistic risk of timing attacks against tokens either way, but I'd want to confirm that suspicion with some research first). Just look up the reset by the token value, invalidate the reset record (you want to save them anyways), and then check whether the email matches.
If you really, really wanted to be paranoid about it, you could just HMAC the token against a secret you pass in through the environment, so that the attacker can't even map inputs to database entries (in the same manner as they can't meaningfully launch a timing attack against a password hash).
But nerdery aside, unless I'm missing it, this piece seems to be lacking one of the most important controls for password resets:
Invalidate reset records after use, after any password change, and after a fixed (short) amount of time.
It is amazing how many applications have password reset schemes that leave login-equivalent data in people's email boxes for all time.
> Invalidate reset records after use, after any password change, and after a fixed (short) amount of time.
That was (somewhat implicitly) covered in the "what incumbent systems" do: https://paragonie.com/blog/2016/09/untangling-forget-me-knot...
Since you mention it, I'll make that a separate list item. It's important enough to risk being repetitive about.
I would say the first most important attribute of a password reset scheme is that it not be based on weak secondary passwords like "Mother's maiden name".
The second most important attribute of a password reset scheme is that it be based on a simple lookup of a random token, and not elaborate encryption schemes, since those schemes tend to cough up game-over auth bypass bugs.
The third post important attribute of a password reset scheme is that they be single-use and rigorously invalidated, so that your application isn't spewing hazmat over people's email spools.
https://paragonie.com/blog/2016/09/untangling-forget-me-knot...
I am starting to think this is the most important thing. Every time I read about an attack or a vulnerability 2 questions pop into my mind.
1. How easy is this to exploit remotely?
2. Is this an attack vector that actually does get used in the wild?
I usually finish both those questions off with "Today and what about next year?"
e.g. It's interesting that quantum computing is going to change quite a few things, but my list of worries is about 1,000 things long, and that's just way too far off to worry about today, or next year.
The attacker compromises the account and generates password recovery tokens.
He then blackmails the user if the user resets it trough support or via account recovery the attacker uses a token to gain access to the account again.
This is a very common tactic in blackmail for online game accounts.
In fact this is also often used to bypass other security controls such as auto account locking.
You compromise the email account, log on the IP or anything else triggers an automatic account unlock the user clears things up with support and the attacket uses the reset token to access the account without triggering a lockout this time around.