Reputation: 32490
I have an ASP.NET that allows users to reset passwords.
The process is
All data is stored securely in a database etc. My main concern is the interaction between page 1 and 2 and ensuring that people cant go directly to page 2, to change their password.
To protect against this I plan to.
My question is. Is this a cunning plan or can anyone see a flaw in it?
Upvotes: 3
Views: 737
Reputation: 643
Step 1 of your plan will probably not work very well, relying on referrer values to be available isn't recommend since it's a) easy to spoof, b) often disabled by paranoid users.
Step 2 sounds like you want to implement a CSRF token type approach, this is a good idea.
The main thing to protect is the security token sent in the email, as long as the attacker can't determine that token without reading email it is relatively safe. If the attacker can read the users email then just about any password recovery scheme will be broken.
Upvotes: 2
Reputation: 9431
Why don't you keep the user on the same page instead? I would use a WizardControl.
If you decide to stay with the two page approach, you can set a flag in your database when the security questions for a given token have been answered correctly. In page 2 you check if the flag is set, if it is not -> redirect to page 1.
Upvotes: 2
Reputation: 46008
I thought the token should be stored in the database and invalidated if:
Upvotes: 2