-
Notifications
You must be signed in to change notification settings - Fork 373
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
[WIP] Fix: Update password should require re-authentication #309
Conversation
3c461b1
to
14a6f1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but we'll need to put this check behind a new env var because of the breaking change. Which defaults to the old behavior, it will save us a huge headache rolling it out.
I thought of a scenario where the user may not know the "current" password, i.e. if they were a magic link signup originally, but now wish to set a password 🤔 Perhaps if |
yeah good point, i discussed this issue with @dthyresson and we came up with an alternative implementation: Instead of asking a user to provide their old password, we should send a The rationale behind this is because gotrue allows a developer many options to sign-in (magiclinks, password-based, oauth) and asking for the old password doesn't really make sense for magiclinks & oauth, but we can be sure that there will at least be an email or phone number associated to the user. |
Can we get this in? it's bizarre to me this was not incorporated when designing the user API's. If on a shared computer, or if a hacker gets a token credentials, the attack blast radius is much larger. They can literally change the user's password and get full access to the account |
closing this in favour of #427 |
What kind of change does this PR introduce?
In case a user's authentication token is stolen, this fix prevents an attacker from updating the user's password and completely taking over the account. Password updates should now require the user to submit their current password for re-authentication.
What is the new behavior?
Password Update Rules
Limitations