| 1 |
========================== |
| 2 |
Django 1.4.2 release notes |
| 3 |
========================== |
| 4 |
|
| 5 |
*October 17, 2012* |
| 6 |
|
| 7 |
This is the second security release in the Django 1.4 series. |
| 8 |
|
| 9 |
Host header poisoning |
| 10 |
===================== |
| 11 |
|
| 12 |
Some parts of Django -- independent of end-user-written applications -- make |
| 13 |
use of full URLs, including domain name, which are generated from the HTTP Host |
| 14 |
header. Some attacks against this are beyond Django's ability to control, and |
| 15 |
require the web server to be properly configured; Django's documentation has |
| 16 |
for some time contained notes advising users on such configuration. |
| 17 |
|
| 18 |
Django's own built-in parsing of the Host header is, however, still vulnerable, |
| 19 |
as was reported to us recently. The Host header parsing in Django 1.3.3 and |
| 20 |
Django 1.4.1 -- specifically, ``django.http.HttpRequest.get_host()`` -- was |
| 21 |
incorrectly handling username/password information in the header. Thus, for |
| 22 |
example, the following Host header would be accepted by Django when running on |
| 23 |
``validsite.com``: |
| 24 |
|
| 25 |
.. code-block:: text |
| 26 |
|
| 27 |
Host: validsite.com:[email protected] |
| 28 |
|
| 29 |
Using this, an attacker can cause parts of Django -- particularly the |
| 30 |
password-reset mechanism -- to generate and display arbitrary URLs to users. |
| 31 |
|
| 32 |
To remedy this, the parsing in ``HttpRequest.get_host()`` is being modified; |
| 33 |
Host headers which contain potentially dangerous content (such as |
| 34 |
username/password pairs) now raise the exception |
| 35 |
:exc:`django.core.exceptions.SuspiciousOperation`. |
| 36 |
|
| 37 |
Details of this issue were initially posted online as a `security advisory`_. |
| 38 |
|
| 39 |
.. _security advisory: https://www.djangoproject.com/weblog/2012/oct/17/security/ |
| 40 |
|
| 41 |
Backwards incompatible changes |
| 42 |
============================== |
| 43 |
|
| 44 |
* The newly introduced :class:`~django.db.models.GenericIPAddressField` |
| 45 |
constructor arguments have been adapted to match those of all other model |
| 46 |
fields. The first two keyword arguments are now verbose_name and name. |
| 47 |
|
| 48 |
Other bugfixes and changes |
| 49 |
========================== |
| 50 |
|
| 51 |
* Subclass HTMLParser only for appropriate Python versions (#18239). |
| 52 |
* Added batch_size argument to qs.bulk_create() (#17788). |
| 53 |
* Fixed a small regression in the admin filters where wrongly formatted dates passed as url parameters caused an unhandled ValidationError (#18530). |
| 54 |
* Fixed an endless loop bug when accessing permissions in templates (#18979) |
| 55 |
* Fixed some Python 2.5 compatibility issues |
| 56 |
* Fixed an issue with quoted filenames in Content-Disposition header (#19006) |
| 57 |
* Made the context option in ``trans`` and ``blocktrans`` tags accept literals wrapped in single quotes (#18881). |
| 58 |
* Numerous documentation improvements and fixes. |