79645269

Date: 2025-05-30 10:12:39
Score: 0.5
Natty:
Report link

You're right to be thinking about security here — password reset flows are critical attack vectors if not handled correctly. Let's walk through the issue and how to solve it.

Don't Reveal Whether an Email Exists
Most modern applications implement the "silent fail" approach:

This prevents email enumeration attacks, where an attacker could test emails and learn which ones are registered.

Reset Link Should Be Secure and Tied to the User

When sending a reset link:

  1. Generate a secure, time-limited token (usually with UserManager.GeneratePasswordResetTokenAsync() in ASP.NET Core Identity).

  2. Store it securely and tie it to the correct user account.

  3. Send a link like:

    https://yourapp.com/account/[email protected]&token=abc123

  4. When the user clicks the link, verify the token and email match, using:

    await UserManager.ResetPasswordAsync(user, token, newPassword);
    

    If the email doesn't exist, no reset token is generated — and no email is sent.

Reasons:
  • Blacklisted phrase (1): how to solve
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Akshay Bandhara