#35492: Replace call to User.set_password with make_password in authenticate
------------------------------------------------+------------------------
Reporter: Natalia Bidart | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.auth | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
In the current implementation of `ModelBackend.authenticate()`,
`set_password()` is invoked on an empty User model to conceal timing
differences between existing and non-existing users, thereby preventing
password timing attacks.
However, relying on `set_password()` in this context may lead to
unintended consequences, given it is a public and overridable method of
the model. The Security Team suggested to directly call `make_password()`
instead to achieve the same desired timing effect.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35492>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.