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

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

Open
josecelano opened this issue Feb 29, 2024 · 4 comments
Open

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

josecelano opened this issue Feb 29, 2024 · 4 comments
Labels
- User - Enjoyable to Use our Software Security Publicly Connected to Security
Milestone

Comments

@josecelano
Copy link
Member

josecelano commented Feb 29, 2024

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

  • Make the email always optional in the sign-up form.
  • Remove configuration option email_on_signup. The email would be always optional.
  • Allow email duplicates. You can sign up with somebody else's email.
  • The application does nothing with the user's email unless is validated. This should be always the case. For example, to reset passwords, send notifications, etc. For the time being, the email is only verified when email_verification_enabled option is enabled. The user's email is not used for anything else.
# ...

[auth]
email_on_signup = "Optional"

# ...

[mail]
email_verification_enabled = false
from = "[email protected]"
reply_to = "[email protected]"
username = ""
password = ""
server = ""
port = 25

# ...

Both proposals are compatible.

cc @torrust/torrustaceans

@josecelano josecelano added this to the v3.1.0 milestone Feb 29, 2024
@josecelano josecelano added Security Publicly Connected to Security - User - Enjoyable to Use our Software labels Feb 29, 2024
@josecelano
Copy link
Member Author

Relates to: #306

@da2ce7
Copy link
Contributor

da2ce7 commented Feb 29, 2024

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
Copy link
Member Author

josecelano commented Feb 29, 2024

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
Copy link
Contributor

mario-nt commented Mar 4, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- User - Enjoyable to Use our Software Security Publicly Connected to Security
Projects
None yet
Development

No branches or pull requests

3 participants