{"title":"Django 1.7.9 release notes","version":"dev","locale":"en","docname":"releases/1.7.9","url":"/en/dev/releases/1.7.9/","canonical":"https://djangodocs.dev/en/dev/releases/1.7.9/","summary":"Django 1.7.9 fixes several security issues and bugs in 1.7.8. In previous versions of Django, the session backends created a new empty record in the session…","html":"<h1>Django 1.7.9 release notes<a class=\"heading-anchor\" href=\"#django-1-7-9-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.7.9 fixes several security issues and bugs in 1.7.8.</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=\"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>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 <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</ul>\n</section>","rootId":"django-1-7-9-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":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/1.7.10","title":"Django 1.7.10 release notes","url":"/en/dev/releases/1.7.10/"},"next":{"docname":"releases/1.7.8","title":"Django 1.7.8 release notes","url":"/en/dev/releases/1.7.8/"},"formats":{"html":"/en/dev/releases/1.7.9/","markdown":"/en/dev/releases/1.7.9.md","json":"/en/dev/releases/1.7.9.json"},"source":"https://github.com/django/django/blob/main/docs/releases/1.7.9.txt","official":"https://docs.djangoproject.com/en/dev/releases/1.7.9/","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"]}