Debian Codegraph @

docs/releases/1.9.3.txt

raw
1 ==========================
2 Django 1.9.3 release notes
3 ==========================
4
5 *March 1, 2016*
6
7 Django 1.9.3 fixes two security issues and several bugs in 1.9.2.
8
9 CVE-2016-2512: Malicious redirect and possible XSS attack via user-supplied redirect URLs containing basic auth
10 ===============================================================================================================
11
12 Django relies on user input in some cases (e.g.
13 ``django.contrib.auth.views.login()`` and :doc:`i18n </topics/i18n/index>`)
14 to redirect the user to an "on success" URL. The security check for these
15 redirects (namely ``django.utils.http.is_safe_url()``) considered some URLs
16 with basic authentication credentials "safe" when they shouldn't be.
17
18 For example, a URL like ``http://mysite.example.com\@attacker.com`` would be
19 considered safe if the request's host is ``http://mysite.example.com``, but
20 redirecting to this URL sends the user to ``attacker.com``.
21
22 Also, if a developer relies on ``is_safe_url()`` to provide safe redirect
23 targets and puts such a URL into a link, they could suffer from an XSS attack.
24
25 CVE-2016-2513: User enumeration through timing difference on password hasher work factor upgrade
26 ================================================================================================
27
28 In each major version of Django since 1.6, the default number of iterations for
29 the ``PBKDF2PasswordHasher`` and its subclasses has increased. This improves
30 the security of the password as the speed of hardware increases, however, it
31 also creates a timing difference between a login request for a user with a
32 password encoded in an older number of iterations and login request for a
33 nonexistent user (which runs the default hasher's default number of iterations
34 since Django 1.6).
35
36 This only affects users who haven't logged in since the iterations were
37 increased. The first time a user logs in after an iterations increase, their
38 password is updated with the new iterations and there is no longer a timing
39 difference.
40
41 The new ``BasePasswordHasher.harden_runtime()`` method allows hashers to bridge
42 the runtime gap between the work factor (e.g. iterations) supplied in existing
43 encoded passwords and the default work factor of the hasher. This method
44 is implemented for ``PBKDF2PasswordHasher`` and ``BCryptPasswordHasher``.
45 The number of rounds for the latter hasher hasn't changed since Django 1.4, but
46 some projects may subclass it and increase the work factor as needed.
47
48 A warning will be emitted for any :ref:`third-party password hashers that don't
49 implement <write-your-own-password-hasher>` a ``harden_runtime()`` method.
50
51 If you have different password hashes in your database (such as SHA1 hashes
52 from users who haven't logged in since the default hasher switched to PBKDF2
53 in Django 1.4), the timing difference on a login request for these users may be
54 even greater and this fix doesn't remedy that difference (or any difference
55 when changing hashers). You may be able to :ref:`upgrade those hashes
56 <wrapping-password-hashers>` to prevent a timing attack for that case.
57
58 Bugfixes
59 ========
60
61 * Skipped URL checks (new in 1.9) if the ``ROOT_URLCONF`` setting isn't defined
62 (:ticket:`26155`).
63
64 * Fixed a crash on PostgreSQL that prevented using ``TIME_ZONE=None`` and
65 ``USE_TZ=False`` (:ticket:`26177`).
66
67 * Added system checks for query name clashes of hidden relationships
68 (:ticket:`26162`).
69
70 * Fixed a regression for cases where
71 ``ForeignObject.get_extra_descriptor_filter()`` returned a ``Q`` object
72 (:ticket:`26153`).
73
74 * Fixed regression with an ``__in=qs`` lookup for a ``ForeignKey`` with
75 ``to_field`` set (:ticket:`26196`).
76
77 * Made ``forms.FileField`` and ``utils.translation.lazy_number()`` picklable
78 (:ticket:`26212`).
79
80 * Fixed :class:`~django.contrib.postgres.fields.RangeField` and
81 :class:`~django.contrib.postgres.fields.ArrayField` serialization with
82 ``None`` values (:ticket:`26215`).
83
84 * Fixed a crash when filtering by a ``Decimal`` in ``RawQuery``
85 (:ticket:`26219`).
86
87 * Reallowed dashes in top-level domain names of URLs checked by
88 ``URLValidator`` to fix a regression in Django 1.8 (:ticket:`26204`).
89
90 * Fixed some crashing deprecation shims in ``SimpleTemplateResponse`` that
91 regressed in Django 1.9 (:ticket:`26253`).
92
93 * Fixed ``BoundField`` to reallow slices of subwidgets (:ticket:`26267`).
94
95 * Changed the admin's "permission denied" message in the login template to use
96 ``get_username`` instead of ``username`` to support custom user models
97 (:ticket:`26231`).
98
99 * Fixed a crash when passing a nonexistent template name to the cached template
100 loader's ``load_template()`` method (:ticket:`26280`).
101
102 * Prevented ``ContentTypeManager`` instances from sharing their cache
103 (:ticket:`26286`).
104
105 * Reverted a change in Django 1.9.2 (:ticket:`25858`) that prevented relative
106 lazy relationships defined on abstract models to be resolved according to
107 their concrete model's ``app_label`` (:ticket:`26186`).