{"title":"Django 1.3.6 release notes","version":"dev","locale":"en","docname":"releases/1.3.6","url":"/en/dev/releases/1.3.6/","canonical":"https://djangodocs.dev/en/dev/releases/1.3.6/","summary":"Django 1.3.6 fixes four security issues present in previous Django releases in the 1.3 series.","html":"<h1>Django 1.3.6 release notes<a class=\"heading-anchor\" href=\"#django-1-3-6-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>February 19, 2013</em></p>\n<p>Django 1.3.6 fixes four security issues present in previous Django releases in\nthe 1.3 series.</p>\n<p>This is the sixth bugfix/security release in the Django 1.3 series.</p>\n<section id=\"host-header-poisoning\">\n<h2>Host header poisoning<a class=\"heading-anchor\" href=\"#host-header-poisoning\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Some parts of Django – independent of end-user-written applications – make\nuse of full URLs, including domain name, which are generated from the HTTP Host\nheader. Django’s documentation has for some time contained notes advising users\non how to configure web servers to ensure that only valid Host headers can\nreach the Django application. However, it has been reported to us that even\nwith the recommended web server configurations there are still techniques\navailable for tricking many common web servers into supplying the application\nwith an incorrect and possibly malicious Host header.</p>\n<p>For this reason, Django 1.3.6 adds a new setting, <code class=\"docutils literal notranslate\">ALLOWED_HOSTS</code>, which\nshould contain an explicit list of valid host/domain names for this site. A\nrequest with a Host header not matching an entry in this list will raise\n<code class=\"docutils literal notranslate\">SuspiciousOperation</code> if <code class=\"docutils literal notranslate\">request.get_host()</code> is called. For full details\nsee the documentation for the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-ALLOWED_HOSTS\"><code class=\"xref std std-setting docutils literal notranslate\">ALLOWED_HOSTS</code></a> setting.</p>\n<p>The default value for this setting in Django 1.3.6 is <code class=\"docutils literal notranslate\">['*']</code> (matching any\nhost), for backwards-compatibility, but we strongly encourage all sites to set\na more restrictive value.</p>\n<p>This host validation is disabled when <code class=\"docutils literal notranslate\">DEBUG</code> is <code class=\"docutils literal notranslate\">True</code> or when running\ntests.</p>\n</section>\n<section id=\"xml-deserialization\">\n<h2>XML deserialization<a class=\"heading-anchor\" href=\"#xml-deserialization\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The XML parser in the Python standard library is vulnerable to a number of\nattacks via external entities and entity expansion. Django uses this parser for\ndeserializing XML-formatted database fixtures. The fixture deserializer is not\nintended for use with untrusted data, but in order to err on the side of safety\nin Django 1.3.6 the XML deserializer refuses to parse an XML document with a\nDTD (DOCTYPE definition), which closes off these attack avenues.</p>\n<p>These issues in the Python standard library are CVE-2013-1664 and\nCVE-2013-1665. More information available <a class=\"reference external\" href=\"https://blog.python.org/2013/02/announcing-defusedxml-fixes-for-xml.html\">from the Python security team</a>.</p>\n<p>Django’s XML serializer does not create documents with a DTD, so this should\nnot cause any issues with the typical round-trip from <code class=\"docutils literal notranslate\">dumpdata</code> to\n<code class=\"docutils literal notranslate\">loaddata</code>, but if you feed your own XML documents to the <code class=\"docutils literal notranslate\">loaddata</code>\nmanagement command, you will need to ensure they do not contain a DTD.</p>\n</section>\n<section id=\"formset-memory-exhaustion\">\n<h2>Formset memory exhaustion<a class=\"heading-anchor\" href=\"#formset-memory-exhaustion\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Previous versions of Django did not validate or limit the form-count data\nprovided by the client in a formset’s management form, making it possible to\nexhaust a server’s available memory by forcing it to create very large numbers\nof forms.</p>\n<p>In Django 1.3.6, all formsets have a strictly-enforced maximum number of forms\n(1000 by default, though it can be set higher via the <code class=\"docutils literal notranslate\">max_num</code> formset\nfactory argument).</p>\n</section>\n<section id=\"admin-history-view-information-leakage\">\n<h2>Admin history view information leakage<a class=\"heading-anchor\" href=\"#admin-history-view-information-leakage\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>In previous versions of Django, an admin user without change permission on a\nmodel could still view the Unicode representation of instances via their admin\nhistory log. Django 1.3.6 now limits the admin history log view for an object\nto users with change permission for that model.</p>\n</section>","rootId":"django-1-3-6-release-notes","toc":[{"title":"Host header poisoning","anchor":"host-header-poisoning","children":[]},{"title":"XML deserialization","anchor":"xml-deserialization","children":[]},{"title":"Formset memory exhaustion","anchor":"formset-memory-exhaustion","children":[]},{"title":"Admin history view information leakage","anchor":"admin-history-view-information-leakage","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/1.3.7","title":"Django 1.3.7 release notes","url":"/en/dev/releases/1.3.7/"},"next":{"docname":"releases/1.3.5","title":"Django 1.3.5 release notes","url":"/en/dev/releases/1.3.5/"},"formats":{"html":"/en/dev/releases/1.3.6/","markdown":"/en/dev/releases/1.3.6.md","json":"/en/dev/releases/1.3.6.json"},"source":"https://github.com/django/django/blob/main/docs/releases/1.3.6.txt","official":"https://docs.djangoproject.com/en/dev/releases/1.3.6/","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"]}