| 1 |
========================== |
| 2 |
Django 1.4.4 release notes |
| 3 |
========================== |
| 4 |
|
| 5 |
*February 19, 2013* |
| 6 |
|
| 7 |
Django 1.4.4 fixes four security issues present in previous Django releases in |
| 8 |
the 1.4 series, as well as several other bugs and numerous documentation |
| 9 |
improvements. |
| 10 |
|
| 11 |
This is the fourth bugfix/security release in the Django 1.4 series. |
| 12 |
|
| 13 |
|
| 14 |
Host header poisoning |
| 15 |
===================== |
| 16 |
|
| 17 |
Some parts of Django -- independent of end-user-written applications -- make |
| 18 |
use of full URLs, including domain name, which are generated from the HTTP Host |
| 19 |
header. Django's documentation has for some time contained notes advising users |
| 20 |
on how to configure web servers to ensure that only valid Host headers can reach |
| 21 |
the Django application. However, it has been reported to us that even with the |
| 22 |
recommended web server configurations there are still techniques available for |
| 23 |
tricking many common web servers into supplying the application with an |
| 24 |
incorrect and possibly malicious Host header. |
| 25 |
|
| 26 |
For this reason, Django 1.4.4 adds a new setting, ``ALLOWED_HOSTS``, containing |
| 27 |
an explicit list of valid host/domain names for this site. A request with a |
| 28 |
Host header not matching an entry in this list will raise |
| 29 |
``SuspiciousOperation`` if ``request.get_host()`` is called. For full details |
| 30 |
see the documentation for the :setting:`ALLOWED_HOSTS` setting. |
| 31 |
|
| 32 |
The default value for this setting in Django 1.4.4 is ``['*']`` (matching any |
| 33 |
host), for backwards-compatibility, but we strongly encourage all sites to set |
| 34 |
a more restrictive value. |
| 35 |
|
| 36 |
This host validation is disabled when ``DEBUG`` is ``True`` or when running tests. |
| 37 |
|
| 38 |
|
| 39 |
XML deserialization |
| 40 |
=================== |
| 41 |
|
| 42 |
The XML parser in the Python standard library is vulnerable to a number of |
| 43 |
attacks via external entities and entity expansion. Django uses this parser for |
| 44 |
deserializing XML-formatted database fixtures. This deserializer is not |
| 45 |
intended for use with untrusted data, but in order to err on the side of safety |
| 46 |
in Django 1.4.4 the XML deserializer refuses to parse an XML document with a |
| 47 |
DTD (DOCTYPE definition), which closes off these attack avenues. |
| 48 |
|
| 49 |
These issues in the Python standard library are CVE-2013-1664 and |
| 50 |
CVE-2013-1665. More information available `from the Python security team`_. |
| 51 |
|
| 52 |
Django's XML serializer does not create documents with a DTD, so this should |
| 53 |
not cause any issues with the typical round-trip from ``dumpdata`` to |
| 54 |
``loaddata``, but if you feed your own XML documents to the ``loaddata`` |
| 55 |
management command, you will need to ensure they do not contain a DTD. |
| 56 |
|
| 57 |
.. _from the Python security team: https://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html |
| 58 |
|
| 59 |
|
| 60 |
Formset memory exhaustion |
| 61 |
========================= |
| 62 |
|
| 63 |
Previous versions of Django did not validate or limit the form-count data |
| 64 |
provided by the client in a formset's management form, making it possible to |
| 65 |
exhaust a server's available memory by forcing it to create very large numbers |
| 66 |
of forms. |
| 67 |
|
| 68 |
In Django 1.4.4, all formsets have a strictly-enforced maximum number of forms |
| 69 |
(1000 by default, though it can be set higher via the ``max_num`` formset |
| 70 |
factory argument). |
| 71 |
|
| 72 |
|
| 73 |
Admin history view information leakage |
| 74 |
====================================== |
| 75 |
|
| 76 |
In previous versions of Django, an admin user without change permission on a |
| 77 |
model could still view the Unicode representation of instances via their admin |
| 78 |
history log. Django 1.4.4 now limits the admin history log view for an object |
| 79 |
to users with change permission for that model. |
| 80 |
|
| 81 |
|
| 82 |
Other bugfixes and changes |
| 83 |
========================== |
| 84 |
|
| 85 |
* Prevented transaction state from leaking from one request to the next (#19707). |
| 86 |
* Changed an SQL command syntax to be MySQL 4 compatible (#19702). |
| 87 |
* Added backwards-compatibility with old unsalted MD5 passwords (#18144). |
| 88 |
* Numerous documentation improvements and fixes. |