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

fix: password reset leaks user existence #3616

Merged
merged 11 commits into from
Sep 14, 2022

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Aug 24, 2022

Part of the security roadmap

Changes proposed in this pull request:

  • Removes unknown user error, throws a validation error instead.
  • Moves password reset logic to a job to prevent leak by duration.

Reviewers should focus on:
I wonder if we should drop the command and move it to the controller now that we also added a job. Would that be a possible breaking change?

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

SychO9 and others added 5 commits August 24, 2022 14:03
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
Copy link
Member

@davwheat davwheat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to consider sending emails to users when their emails aren't registered (ratelimited, obviously) so that a user doesn't sit aimlessly for minutes if they enter one of two emails they might have used, for example.

I know some other services do this, with something like "You've requested a password reset, but we didn't find a user associated with this email address", etc.

framework/core/locale/core.yml Outdated Show resolved Hide resolved
Co-authored-by: David Wheatley <hi@davwheat.dev>
@SychO9
Copy link
Member Author

SychO9 commented Aug 24, 2022

hmm 🤔 I don't know if we would want to send emails to non-registered users, but yeah would definitely require rate limiting which would need to be implemented separately as it would be a cache-based implementation possibly reusing the laravel one and allowing for easy re-usage.

@SychO9 SychO9 self-assigned this Aug 24, 2022
@davwheat
Copy link
Member

Yeah, fair point. We should be extra careful about spam to non-users.

@SychO9 SychO9 requested a review from davwheat September 2, 2022 20:45
@SychO9 SychO9 requested a review from askvortsov1 September 2, 2022 21:09
framework/core/locale/core.yml Outdated Show resolved Hide resolved
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
@SychO9 SychO9 requested a review from a team as a code owner September 6, 2022 18:14
Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
@SychO9 SychO9 requested a review from askvortsov1 September 6, 2022 19:36
@SychO9 SychO9 added this to the 1.6 milestone Sep 6, 2022
@SychO9 SychO9 merged commit 84c3116 into main Sep 14, 2022
@SychO9 SychO9 deleted the sm/prevent-leaking-user-existence-in-password-reset branch September 14, 2022 14:57
@luceos luceos mentioned this pull request Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: completed
Development

Successfully merging this pull request may close these issues.

5 participants