Skip to content

serializers fails to sanitize the email in the ResetPasswordRequestToken view #144

@JoueBien

Description

@JoueBien

The route

`/rest-auth/password_reset/` 

is able to accept malformed emails. The sanitization doesn't strip leading or trailing spaces. This along with

DJANGO_REST_PASSWORDRESET_NO_INFORMATION_LEAKAGE = True

means that users can end up getting stuck with not getting a re-set email even if they entered in a seemingly valid email.

The change I would suggest is with ResetPasswordRequestToken@POST:

# this 
email = serializer.validated_data['email']
# should probably be this
email = serializer.validated_data['email'].strip()

There probably should be a regression test added to your test suite as well.

Metadata

Metadata

Assignees

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