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

Email Unverified error returns even with Incorrect Password #4693

Closed
dblythy opened this issue Apr 2, 2018 · 8 comments
Closed

Email Unverified error returns even with Incorrect Password #4693

dblythy opened this issue Apr 2, 2018 · 8 comments

Comments

@dblythy
Copy link
Member

dblythy commented Apr 2, 2018

Issue Description

Logging in with an incorrect password returns email unverified instead of incorrect username or password. I am giving users the option to use /verificationEmailRequest on error code 205, however error code 205 returned on incorrect password.

Steps to reproduce

Create an account with preventLoginWithUnverifiedEmail set to true. Login immediately with incorrect password and error will be "email not verified".

Expected Results

Incorrect password error.

Actual Outcome

Email not verified error.

Environment Setup

  • Server
    • parse-server version: 2.7.4
    • Localhost
@paulovitin
Copy link
Contributor

Im not understand the wrong behavior.

The docs says: set preventLoginWithUnverifiedEmail to true to prevent user from login if their email is not verified

So, if you set true, the error returned its correct. I missing something?

@dblythy
Copy link
Member Author

dblythy commented Apr 8, 2018

@paulovitin yes, prevents logging in correctly. However even if the password is incorrect it returns. It should first return incorrect username/password, and then once password is correct, it should return email not verified.

@dblythy dblythy closed this as completed Apr 8, 2018
@dblythy dblythy reopened this Apr 8, 2018
@paulovitin
Copy link
Contributor

paulovitin commented Apr 8, 2018

@dblythy the first information for user login is the e-mail, so, the app needs validade the e-mail. The e-mail is unverified, then the first error is e-mail unverified...

The second step is check the password... But the e-mail error already been returned.

@dblythy
Copy link
Member Author

dblythy commented Apr 10, 2018

I want to prompt unverified users after login (correct password) with "resend verification email". Point being, they can find out a users email address before they verify their email.

Just as an incorrect password returns "invalid email/password", not "invalid password" to hide a database users email, incorrect password before verification returns "unverified email" - revealing an unverified user's email.

@paulovitin
Copy link
Contributor

@montymxb can you help here?

@dblythy
Copy link
Member Author

dblythy commented Apr 10, 2018

Potentially, if a malicious user brute forced emails, all they would need is to attempt login and search for error 205 to get a users email. Then wait until they verify and brute force password.

@flovilmart
Copy link
Contributor

Can one of you open a PR to reverse the order of the errors?

@dblythy
Copy link
Member Author

dblythy commented Apr 10, 2018

Yep! Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants