Skip to content

Wrong error message when valid email format of not existing user and fake password provided #760

@meceo

Description

@meceo

ISSUES THAT DO NOT FOLLOW THIS TEMPLATE WILL BE CLOSED IMMEDIATELY.

  • This is not a usage question.
    • Our volunteers' time is limited, so please ask usage questions on
      StackOverflow.
  • This is not a security issue.
  • This bug is reproducible with a clean install of authlogic
  • I am committed to fixing this in a reasonable amount of time, and
    responding promptly to feedback.

Expected Behavior

For the login form. If the email of a not existing user is in the correct format (for example xx@xx.com) and a fake password is provided the error notification says: "Email is not valid".

(rdbg) @user_session    # ruby
#<UserSession: {:email=>"xx@xx.com", :password=>"<protected>"}>
(rdbg) @user_session.errors    # ruby
#<ActiveModel::Errors [#<ActiveModel::Error attribute=email, type=is not valid, options={}>]>

Additionally, the error message can't be translated using official translation keys. Other errors can be translated successfuly.

pl:
  authlogic:
    error_messages:
      ...
      email_invalid: xxx should look like an email address.
      ...

Actual Behavior

The actual error message should be of type general_credentials_error because the email is valid. It simply doesn't exist in the database, but that information should not be exposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions