{"title":"Django 1.4.3 release notes","version":"dev","locale":"en","docname":"releases/1.4.3","url":"/en/dev/releases/1.4.3/","canonical":"https://djangodocs.dev/en/dev/releases/1.4.3/","summary":"Django 1.4.3 addresses two security issues present in previous Django releases in the 1.4 series.","html":"<h1>Django 1.4.3 release notes<a class=\"heading-anchor\" href=\"#django-1-4-3-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>December 10, 2012</em></p>\n<p>Django 1.4.3 addresses two security issues present in previous Django releases\nin the 1.4 series.</p>\n<p>Please be aware that this security release is slightly different from previous\nones. Both issues addressed here have been dealt with in prior security updates\nto Django. In one case, we have received ongoing reports of problems, and in\nthe other we’ve chosen to take further steps to tighten up Django’s code in\nresponse to independent discovery of potential problems from multiple sources.</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>Several earlier Django security releases focused on the issue of poisoning the\nHTTP Host header, causing Django to generate URLs pointing to arbitrary,\npotentially-malicious domains.</p>\n<p>In response to further input received and reports of continuing issues\nfollowing the previous release, we’re taking additional steps to tighten Host\nheader validation. Rather than attempt to accommodate all features HTTP\nsupports here, Django’s Host header validation attempts to support a smaller,\nbut far more common, subset:</p>\n<ul class=\"simple\">\n<li><p>Hostnames must consist of characters <code class=\"docutils literal notranslate\">[A-Za-z0-9]</code> plus hyphen (‘-’) or dot\n(‘.’).</p></li>\n<li><p>IP addresses – both IPv4 and IPv6 – are permitted.</p></li>\n<li><p>Port, if specified, is numeric.</p></li>\n</ul>\n<p>Any deviation from this will now be rejected, raising the exception\n<a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.SuspiciousOperation\" title=\"django.core.exceptions.SuspiciousOperation\"><code class=\"xref py py-exc docutils literal notranslate\">django.core.exceptions.SuspiciousOperation</code></a>.</p>\n</section>\n<section id=\"redirect-poisoning\">\n<h2>Redirect poisoning<a class=\"heading-anchor\" href=\"#redirect-poisoning\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Also following up on a previous issue: in July of this year, we made changes to\nDjango’s HTTP redirect classes, performing additional validation of the scheme\nof the URL to redirect to (since, both within Django’s own supplied\napplications and many third-party applications, accepting a user-supplied\nredirect target is a common pattern).</p>\n<p>Since then, two independent audits of the code turned up further potential\nproblems. So, similar to the Host-header issue, we are taking steps to provide\ntighter validation in response to reported problems (primarily with third-party\napplications, but to a certain extent also within Django itself). This comes in\ntwo parts:</p>\n<p>1. A new utility function, <code class=\"docutils literal notranslate\">django.utils.http.is_safe_url</code>, is added; this\nfunction takes a URL and a hostname, and checks that the URL is either\nrelative, or if absolute matches the supplied hostname. This function is\nintended for use whenever user-supplied redirect targets are accepted, to\nensure that such redirects cannot lead to arbitrary third-party sites.</p>\n<p>2. All of Django’s own built-in views – primarily in the authentication system\n– which allow user-supplied redirect targets now use <code class=\"docutils literal notranslate\">is_safe_url</code> to\nvalidate the supplied URL.</p>\n</section>","rootId":"django-1-4-3-release-notes","toc":[{"title":"Host header poisoning","anchor":"host-header-poisoning","children":[]},{"title":"Redirect poisoning","anchor":"redirect-poisoning","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/1.4.4","title":"Django 1.4.4 release notes","url":"/en/dev/releases/1.4.4/"},"next":{"docname":"releases/1.4.2","title":"Django 1.4.2 release notes","url":"/en/dev/releases/1.4.2/"},"formats":{"html":"/en/dev/releases/1.4.3/","markdown":"/en/dev/releases/1.4.3.md","json":"/en/dev/releases/1.4.3.json"},"source":"https://github.com/django/django/blob/main/docs/releases/1.4.3.txt","official":"https://docs.djangoproject.com/en/dev/releases/1.4.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"]}