{"title":"Django 1.8.3 release notes","version":"dev","locale":"en","docname":"releases/1.8.3","url":"/en/dev/releases/1.8.3/","canonical":"https://djangodocs.dev/en/dev/releases/1.8.3/","summary":"Django 1.8.3 fixes several security issues and bugs in 1.8.2. Also, django.utils.deprecation.RemovedInDjango20Warning was renamed to RemovedInDjango110Warnin…","html":"<h1>Django 1.8.3 release notes<a class=\"heading-anchor\" href=\"#django-1-8-3-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>July 8, 2015</em></p>\n<p>Django 1.8.3 fixes several security issues and bugs in 1.8.2.</p>\n<p>Also, <code class=\"docutils literal notranslate\">django.utils.deprecation.RemovedInDjango20Warning</code> was renamed to\n<code class=\"docutils literal notranslate\">RemovedInDjango110Warning</code> as the version roadmap was revised to 1.9, 1.10,\n1.11 (LTS), 2.0 (drops Python 2 support). For backwards compatibility,\n<code class=\"docutils literal notranslate\">RemovedInDjango20Warning</code> remains as an importable alias.</p>\n<section id=\"denial-of-service-possibility-by-filling-session-store\">\n<h2>Denial-of-service possibility by filling session store<a class=\"heading-anchor\" href=\"#denial-of-service-possibility-by-filling-session-store\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>In previous versions of Django, the session backends created a new empty record\nin the session storage anytime <code class=\"docutils literal notranslate\">request.session</code> was accessed and there was a\nsession key provided in the request cookies that didn’t already have a session\nrecord. This could allow an attacker to easily create many new session records\nsimply by sending repeated requests with unknown session keys, potentially\nfilling up the session store or causing other users’ session records to be\nevicted.</p>\n<p>The built-in session backends now create a session record only if the session\nis actually modified; empty session records are not created. Thus this\npotential DoS is now only possible if the site chooses to expose a\nsession-modifying view to anonymous users.</p>\n<p>As each built-in session backend was fixed separately (rather than a fix in the\ncore sessions framework), maintainers of third-party session backends should\ncheck whether the same vulnerability is present in their backend and correct\nit if so.</p>\n</section>\n<section id=\"header-injection-possibility-since-validators-accept-newlines-in-input\">\n<h2>Header injection possibility since validators accept newlines in input<a class=\"heading-anchor\" href=\"#header-injection-possibility-since-validators-accept-newlines-in-input\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Some of Django’s built-in validators\n(<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.EmailValidator\" title=\"django.core.validators.EmailValidator\"><code class=\"xref py py-class docutils literal notranslate\">EmailValidator</code></a>, most seriously) didn’t\nprohibit newline characters (due to the usage of <code class=\"docutils literal notranslate\">$</code> instead of <code class=\"docutils literal notranslate\">\\Z</code> in the\nregular expressions). If you use values with newlines in HTTP response or email\nheaders, you can suffer from header injection attacks. Django itself isn’t\nvulnerable because <a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponse\" title=\"django.http.HttpResponse\"><code class=\"xref py py-class docutils literal notranslate\">HttpResponse</code></a> and the mail sending\nutilities in <a class=\"reference internal\" href=\"/en/dev/topics/email/#module-django.core.mail\" title=\"django.core.mail: Helpers to send email.\"><code class=\"xref py py-mod docutils literal notranslate\">django.core.mail</code></a> prohibit newlines in HTTP and SMTP\nheaders, respectively. While the validators have been fixed in Django, if\nyou’re creating HTTP responses or email messages in other ways, it’s a good\nidea to ensure that those methods prohibit newlines as well. You might also\nwant to validate that any existing data in your application doesn’t contain\nunexpected newlines.</p>\n<p><a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.validate_ipv4_address\" title=\"django.core.validators.validate_ipv4_address\"><code class=\"xref py py-func docutils literal notranslate\">validate_ipv4_address()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.validate_slug\" title=\"django.core.validators.validate_slug\"><code class=\"xref py py-func docutils literal notranslate\">validate_slug()</code></a>, and\n<a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.URLValidator\" title=\"django.core.validators.URLValidator\"><code class=\"xref py py-class docutils literal notranslate\">URLValidator</code></a> are also affected, however, as\nof Django 1.6 the <code class=\"docutils literal notranslate\">GenericIPAddresseField</code>, <code class=\"docutils literal notranslate\">IPAddressField</code>,\n<code class=\"docutils literal notranslate\">SlugField</code>, and <code class=\"docutils literal notranslate\">URLField</code> form fields which use these validators all\nstrip the input, so the possibility of newlines entering your data only exists\nif you are using these validators outside of the form fields.</p>\n<p>The undocumented, internally unused <code class=\"docutils literal notranslate\">validate_integer()</code> function is now\nstricter as it validates using a regular expression instead of simply casting\nthe value using <code class=\"docutils literal notranslate\">int()</code> and checking if an exception was raised.</p>\n</section>\n<section id=\"denial-of-service-possibility-in-url-validation\">\n<h2>Denial-of-service possibility in URL validation<a class=\"heading-anchor\" href=\"#denial-of-service-possibility-in-url-validation\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.URLValidator\" title=\"django.core.validators.URLValidator\"><code class=\"xref py py-class docutils literal notranslate\">URLValidator</code></a> included a regular expression\nthat was extremely slow to evaluate against certain invalid inputs. This\nregular expression has been simplified and optimized.</p>\n</section>\n<section id=\"bugfixes\">\n<h2>Bugfixes<a class=\"heading-anchor\" href=\"#bugfixes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<ul class=\"simple\">\n<li><p>Fixed <code class=\"docutils literal notranslate\">BaseRangeField.prepare_value()</code> to use each <code class=\"docutils literal notranslate\">base_field</code>’s\n<code class=\"docutils literal notranslate\">prepare_value()</code> method (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24841\">#24841</a>).</p></li>\n<li><p>Fixed crash during <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-makemigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemigrations</code></a> if a migrations module either\nis missing <code class=\"docutils literal notranslate\">__init__.py</code> or is a file (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24848\">#24848</a>).</p></li>\n<li><p>Fixed <code class=\"docutils literal notranslate\">QuerySet.exists()</code> returning incorrect results after annotation with\n<code class=\"docutils literal notranslate\">Count()</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24835\">#24835</a>).</p></li>\n<li><p>Corrected <code class=\"docutils literal notranslate\">HStoreField.has_changed()</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24844\">#24844</a>).</p></li>\n<li><p>Reverted an optimization to the CSRF template context processor which caused\na regression (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24836\">#24836</a>).</p></li>\n<li><p>Fixed a regression which caused template context processors to overwrite\nvariables set on a <code class=\"docutils literal notranslate\">RequestContext</code> after it’s created (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24847\">#24847</a>).</p></li>\n<li><p>Prevented the loss of <code class=\"docutils literal notranslate\">null</code>/<code class=\"docutils literal notranslate\">not null</code> column properties during field\nrenaming of MySQL databases (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24817\">#24817</a>).</p></li>\n<li><p>Fixed a crash when using a reverse one-to-one relation in\n<code class=\"docutils literal notranslate\">ModelAdmin.list_display</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24851\">#24851</a>).</p></li>\n<li><p>Fixed quoting of SQL when renaming a field to <code class=\"docutils literal notranslate\">AutoField</code> in PostgreSQL\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24892\">#24892</a>).</p></li>\n<li><p>Fixed lack of unique constraint when changing a field from\n<code class=\"docutils literal notranslate\">primary_key=True</code> to <code class=\"docutils literal notranslate\">unique=True</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24893\">#24893</a>).</p></li>\n<li><p>Fixed queryset pickling when using <code class=\"docutils literal notranslate\">prefetch_related()</code> after deleting\nobjects (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24831\">#24831</a>).</p></li>\n<li><p>Allowed using <code class=\"docutils literal notranslate\">choices</code> longer than 1 day with <code class=\"docutils literal notranslate\">DurationField</code>\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24897\">#24897</a>).</p></li>\n<li><p>Fixed a crash when loading squashed migrations from two apps with a\ndependency between them, where the dependent app’s replaced migrations are\npartially applied (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24895\">#24895</a>).</p></li>\n<li><p>Fixed recording of applied status for squashed (replacement) migrations\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24628\">#24628</a>).</p></li>\n<li><p>Fixed queryset annotations when using <code class=\"docutils literal notranslate\">Case</code> expressions with <code class=\"docutils literal notranslate\">exclude()</code>\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24833\">#24833</a>).</p></li>\n<li><p>Corrected join promotion for multiple <code class=\"docutils literal notranslate\">Case</code> expressions. Annotating a\nquery with multiple  <code class=\"docutils literal notranslate\">Case</code> expressions could unexpectedly filter out\nresults (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24924\">#24924</a>).</p></li>\n<li><p>Fixed usage of transforms in subqueries (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24744\">#24744</a>).</p></li>\n<li><p>Fixed <code class=\"docutils literal notranslate\">SimpleTestCase.assertRaisesMessage()</code> on Python 2.7.10\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24903\">#24903</a>).</p></li>\n<li><p>Provided better backwards compatibility for the <code class=\"docutils literal notranslate\">verbosity</code> argument in\n<code class=\"docutils literal notranslate\">optparse</code> management commands by casting it to an integer\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24769\">#24769</a>).</p></li>\n<li><p>Fixed <code class=\"docutils literal notranslate\">prefetch_related()</code> on databases other than PostgreSQL for models\nusing UUID primary keys (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24912\">#24912</a>).</p></li>\n<li><p>Fixed removing <code class=\"docutils literal notranslate\">unique_together</code> constraints on MySQL (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24972\">#24972</a>).</p></li>\n<li><p>Fixed crash when uploading images with MIME types that Pillow doesn’t detect,\nsuch as bitmap, in <code class=\"docutils literal notranslate\">forms.ImageField</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24948\">#24948</a>).</p></li>\n<li><p>Fixed a regression when deleting a model through the admin that has a\n<code class=\"docutils literal notranslate\">GenericRelation</code> with a <code class=\"docutils literal notranslate\">related_query_name</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24940\">#24940</a>).</p></li>\n<li><p>Reallowed non-ASCII values for <code class=\"docutils literal notranslate\">ForeignKey.related_name</code> on Python 3 by\nfixing the false positive system check (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/25016\">#25016</a>).</p></li>\n<li><p>Fixed inline forms that use a parent object that has a <code class=\"docutils literal notranslate\">UUIDField</code> primary\nkey and a child object that has an <code class=\"docutils literal notranslate\">AutoField</code> primary key\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/24958\">#24958</a>).</p></li>\n<li><p>Fixed a regression in the <code class=\"docutils literal notranslate\">unordered_list</code> template filter on certain\ninputs (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/25031\">#25031</a>).</p></li>\n<li><p>Fixed a regression in <code class=\"docutils literal notranslate\">URLValidator</code> that invalidated Punycode TLDs\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/25059\">#25059</a>).</p></li>\n<li><p>Improved <code class=\"docutils literal notranslate\">pyinotify</code> <code class=\"docutils literal notranslate\">runserver</code> polling (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/23882\">#23882</a>).</p></li>\n</ul>\n</section>","rootId":"django-1-8-3-release-notes","toc":[{"title":"Denial-of-service possibility by filling session store","anchor":"denial-of-service-possibility-by-filling-session-store","children":[]},{"title":"Header injection possibility since validators accept newlines in input","anchor":"header-injection-possibility-since-validators-accept-newlines-in-input","children":[]},{"title":"Denial-of-service possibility in URL validation","anchor":"denial-of-service-possibility-in-url-validation","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/1.8.4","title":"Django 1.8.4 release notes","url":"/en/dev/releases/1.8.4/"},"next":{"docname":"releases/1.8.2","title":"Django 1.8.2 release notes","url":"/en/dev/releases/1.8.2/"},"formats":{"html":"/en/dev/releases/1.8.3/","markdown":"/en/dev/releases/1.8.3.md","json":"/en/dev/releases/1.8.3.json"},"source":"https://github.com/django/django/blob/main/docs/releases/1.8.3.txt","official":"https://docs.djangoproject.com/en/dev/releases/1.8.3/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10","1.9","1.8"],"inLocales":["en"]}