torrust / torrust-index

This repository serves as the backend for the Torrust Index project.
https://torrust.com
GNU Affero General Public License v3.0
46 stars 19 forks source link

Mitigate the risk of information leakage through sign-up forms #507

Open josecelano opened 5 months ago

josecelano commented 5 months ago

When you use an email that has already been used by another user you get a message like this:

image

That allows users to easily check is a user with a given email is registered. Although this is very common behavior in a lot of online services, for example, LinkedIn:

image

I think we should try to mitigate it.

Proposal 1

Add a captcha and/or a rate limit (IP) to the registration form to at least make it harder to automatize checking a list of emails.

Proposal 2

# ...

[auth]
email_on_signup = "Optional"

# ...

[mail]
email_verification_enabled = false
from = "example@email.com"
reply_to = "noreply@email.com"
username = ""
password = ""
server = ""
port = 25

# ...

Both proposals are compatible.

cc @torrust/torrustaceans

josecelano commented 5 months ago

Relates to: https://github.com/torrust/torrust-index/discussions/306

da2ce7 commented 5 months ago

Option 3:

Do not register the user until the email has been validated.

  1. Ask the user to enter email.
  2. Send email to user: a. Send registration link, if unregistered. b. Send "you already have an account" email, if already registered.
  3. User completes registration, logs in, or reset password.
josecelano commented 5 months ago

Option 3:

Do not register the user until the email has been validated.

  1. Ask the user to enter email.
  2. Send email to user: a. Send registration link, if unregistered. b. Send "you already have an account" email, if already registered.
  3. User completes registration, logs in, or reset password.

Option 3:

Do not register the user until the email has been validated.

  1. Ask the user to enter email.
  2. Send email to user: a. Send registration link, if unregistered. b. Send "you already have an account" email, if already registered.
  3. User completes registration, logs in, or reset password.

Hi @da2ce7 I think that is what the program does when email_on_signup is Required and email_verification_enabled is true. But currently it also tells you that the email is taken. We could simply allow duplicate emails, but a user could mistakenly write a wrong email which is valid. In that case, would be impossible to re-use that account (username).

mario-nt commented 5 months ago

@josecelano @da2ce7

I would do the following:

  1. Don't allow users to register until they verify their email adress.
  2. Add a captcha and/or a rate limit (IP) to the registration form to at least, make it harder to automatize checking a list of emails.
  3. I would NOT allow to have more than one account with the same email
  4. If a user tries to sign up/log in with someone's else's email, we could send a security warning to that email every time, letting that user know that someone is trying to sign up or sign in using that email.

I also think it could do some more research on this topic and see how other apps implements it.