Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With JWT password reset token can be used more than once #68

Open
velascopja opened this issue Mar 25, 2019 · 2 comments
Open

With JWT password reset token can be used more than once #68

velascopja opened this issue Mar 25, 2019 · 2 comments

Comments

@velascopja
Copy link

velascopja commented Mar 25, 2019

It would be great if activator checks that the reset password token can be used only once.

As you suggest in issue #67, including the hash of the current password in the reset password token sounds great to me.

@deitch
Copy link
Owner

deitch commented Mar 26, 2019

Yes, we need to ensure it is used only once. When we didn't have JWT, we depended on a particular database structure. While that had significant downsides, one upside was that we could check if a reset token had been used. With JWT, we do not, which can be an issue.

Current suggestion is to include the first part of the existing hashed password - or even some algorithm generated by it - in the JWT itself, so that if it doesn't match, we reject it.

@deitch
Copy link
Owner

deitch commented Mar 26, 2019

Hmm, not so simple. We actually no longer get the existing password from user.find(), which is good, but eliminates using that as a seed.

Essentially, we are trying to use a per-reset nonce to prevent a replay attack. We need somewhere to store that nonce so we can validate it just for this request, or reliably generate it as just once. Without some persistent storage - which activator does not have - it does get challenging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants