Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Unambiguous non-existent user/invalid password messages via JSON. #673

@usrbinsam

Description

@usrbinsam

In addition to #357, Flask-Security gives attackers hints to whether the username or password is invalid. Even if you change SECURITY_MSG_USER_DOES_NOT_EXIST and SECURITY_MSG_INVALID_PASSWORD to use ambiguous wording, talking to the login view via JSON (for example) will still give hints whether the email or password is incorrect.

For an invalid password, the response looks like:

{'meta': {'code': 400},
 'response': {'errors': {'password': ['Invalid username or password']}}}

And a non existent user:

{'meta': {'code': 400},
 'response': {'errors': {'email': ['Invalid username or password']}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions