Skip to content

Account creation succeeds with empty strings for username, email, password #3658

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

Closed
jordanhbuiltbyhq opened this issue Mar 22, 2017 · 1 comment

Comments

@jordanhbuiltbyhq
Copy link

Issue Description

If you submit an empty string for username, email, and password and trigger sign up from the iOS SDK, an account is created. A random username is generated. Email is empty string. I assume password is an empty string as well, but I cannot verify because login prevents you from signing in with empty string for the password.

Steps to reproduce

Run this code on iOS (SDK 1.14.3):

let user = PFUser()
user.email = ""
user.username = ""
user.password = ""
user.signUpInBackground { (success, error) in
    //gasp, succeeded with no error
}

Expected Results

Validations should fail with error stating you cannot create an account, probably should not accept empty string for any of those but certainly not all three.

Actual Outcome

An account is created successfully

Environment Setup

  • Server

    • parse-server version: 2.3.7
    • Operating System: assuming linux
    • Hardware: not sure
    • Localhost or remote server? Remote on Heroku
  • Database

    • MongoDB version: 3.2.12 (MMAPv1)
    • Storage engine: not sure
    • Hardware: not sure
    • Localhost or remote server? Remote on mLab

Logs/Trace

Not applicable

@jordanhbuiltbyhq jordanhbuiltbyhq changed the title Account creation succeeds passing empty strings for username, email, password Account creation succeeds with empty strings for username, email, password Mar 22, 2017
@imwiss
Copy link
Contributor

imwiss commented Mar 23, 2017

Hey @jordanhbuiltbyhq, I just fixed this issue in PR #3650 and the fix should be out in the next release. The fix prevents signing up with an empty username or password, but it doesn't check for empty emails. Technically, since the email field is an index, 2 users shouldn't be able to sign up with an empty email address.

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