Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21291 closed Bug (fixed)

PasswordResetForm allows password reset for inactive users

Reported by: kz26 Owned by: Claude Paroz
Component: contrib.auth Version: dev
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: yes UI/UX: no

Description

Confirmed in master and Django 1.6b4.

The following resolves this issue:
self.users_cache = UserModel._default_manager.filter(emailiexact=email, is_active=True)

Introduced in commit https://github.com/django/django/commit/2f4a4703e1931fadf5ed81387b26cf84caf5bef9

Change History (7)

comment:1 by Daniele Procida, 11 years ago

Allows reset for what, exactly? Something's missing in the description!

comment:2 by kz26, 11 years ago

Summary: django.contrib.auth.forms.PasswordResetForm allows password reset forPasswordResetForm allows password reset for inactive users

in reply to:  1 comment:3 by kz26, 11 years ago

Replying to EvilDMP:

Allows reset for what, exactly? Something's missing in the description!

Sorry, title fixed! Password reset emails are sent for users with is_active = False.

From the Django documentation: PasswordResetForm "Assumes that the user model has an integer primary key, has a field named email that can be used to identify the user, and a boolean field named is_active to prevent password resets for inactive users."

comment:4 by Claude Paroz, 11 years ago

Owner: changed from nobody to Claude Paroz
Patch needs improvement: set
Status: newassigned
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Also note that test_inactive_user is deficient, it's missing the form.save()call.

comment:5 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 5f52590368063fc8284e23be492d83ba751f66bf:

Fixed #21291 -- Ensured inactive users cannot reset their passwords

Thanks kz26 for the report and the suggested fix. Refs #19758.

comment:6 by Claude Paroz <claude@…>, 11 years ago

In 0c850e28858016b5890ae83a6ec6880614b306a2:

[1.6.x] Fixed #21291 -- Ensured inactive users cannot reset their passwords

Thanks kz26 for the report and the suggested fix. Refs #19758.

Backport of 5f5259036 from master.

comment:7 by Fraser Nevett, 11 years ago

For reference, changes for this ticket introduced new issue #22192.

Note: See TracTickets for help on using tickets.
Back to Top