abpframework / abp

Open Source Web Application Framework for ASP.NET Core. Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET and the ASP.NET Core platforms. Provides the fundamental infrastructure, production-ready startup templates, application modules, UI themes, tooling, guides and documentation.
https://abp.io
GNU Lesser General Public License v3.0
12.27k stars 3.32k forks source link

Prevent e-mail address enumeration #19588

Closed ebicoglu closed 1 week ago

ebicoglu commented 2 weeks ago

Security vulnerability description:

It is possible to collect valid email addresses by interacting with the "Forgot Password" function of the application. This vulnerability is useful to increase the efficiency of brute force attacks. If the email is known, it is easier to find the corresponding password. The affected URL is /Account/ForgotPassword.

With the "Forgot Password" function, the security consultants were able to enumerate valid email addresses as the function returns "Cannot find the given email" error, when there is no user registered with the provided e- mail address. Figure 12 shows the error message received if the email is not registered.

image

If a user is registered with the provided email address, the application informs them that a recovery email has been sent as shown below.

image

Ref: https://portswigger.net/blog/preventing-username-enumeration


Explanation for this security issue:

This behavior is user-friendly, and it's a tradeoff between being user-friendly and security-friendly. The following popular websites all show user-friendly warning messages about user existence. So this is a worldwide accepted behavior.

image


Solution:

We can give this security level as an option. By default current behaviour will be valid. With an extra configuration, we can change the response of "forget my password request". If this option is enabled, we shouldn't show positive or negative responses if the user enters a valid email or not. Always show a generic message as the following :

If the provided e-mail address is registered in the system, we will send a password reset link. If you don't get an email within a few minutes, please check your spam box or try again later.