Django 1.9.3 release notes¶
March 1, 2016
Django 1.9.3 fixes two security issues and several bugs in 1.9.2.
CVE-2016-2512: Malicious redirect and possible XSS attack via user-supplied redirect URLs containing basic auth¶
Django relies on user input in some cases (e.g.
django.contrib.auth.views.login() and i18n)
to redirect the user to an “on success” URL. The security check for these
django.utils.http.is_safe_url()) considered some URLs
with basic authentication credentials “safe” when they shouldn’t be.
For example, a URL like
http://mysite.example.com\@attacker.com would be
considered safe if the request’s host is
redirecting to this URL sends the user to
Also, if a developer relies on
is_safe_url() to provide safe redirect
targets and puts such a URL into a link, they could suffer from an XSS attack.
CVE-2016-2513: User enumeration through timing difference on password hasher work factor upgrade¶
In each major version of Django since 1.6, the default number of iterations for
PBKDF2PasswordHasher and its subclasses has increased. This improves
the security of the password as the speed of hardware increases, however, it
also creates a timing difference between a login request for a user with a
password encoded in an older number of iterations and login request for a
nonexistent user (which runs the default hasher’s default number of iterations
since Django 1.6).
This only affects users who haven’t logged in since the iterations were increased. The first time a user logs in after an iterations increase, their password is updated with the new iterations and there is no longer a timing difference.
BasePasswordHasher.harden_runtime() method allows hashers to bridge
the runtime gap between the work factor (e.g. iterations) supplied in existing
encoded passwords and the default work factor of the hasher. This method
is implemented for
The number of rounds for the latter hasher hasn’t changed since Django 1.4, but
some projects may subclass it and increase the work factor as needed.
A warning will be emitted for any third-party password hashers that don’t
If you have different password hashes in your database (such as SHA1 hashes from users who haven’t logged in since the default hasher switched to PBKDF2 in Django 1.4), the timing difference on a login request for these users may be even greater and this fix doesn’t remedy that difference (or any difference when changing hashers). You may be able to upgrade those hashes to prevent a timing attack for that case.
- Skipped URL checks (new in 1.9) if the
ROOT_URLCONFsetting isn’t defined (#26155).
- Fixed a crash on PostgreSQL that prevented using
- Added system checks for query name clashes of hidden relationships (#26162).
- Fixed a regression for cases where
- Fixed regression with an
__in=qslookup for a
- Fixed a crash when filtering by a
- Reallowed dashes in top-level domain names of URLs checked by
URLValidatorto fix a regression in Django 1.8 (#26204).
- Fixed some crashing deprecation shims in
SimpleTemplateResponsethat regressed in Django 1.9 (#26253).
BoundFieldto reallow slices of subwidgets (#26267).
- Changed the admin’s “permission denied” message in the login template to use
usernameto support custom user models (#26231).
- Fixed a crash when passing a nonexistent template name to the cached template
ContentTypeManagerinstances from sharing their cache (#26286).
- Reverted a change in Django 1.9.2 (#25858) that prevented relative
lazy relationships defined on abstract models to be resolved according to
their concrete model’s