{"title":"Django 1.4.20 release notes","version":"dev","locale":"en","docname":"releases/1.4.20","url":"/en/dev/releases/1.4.20/","canonical":"https://djangodocs.dev/en/dev/releases/1.4.20/","summary":"Django 1.4.20 fixes one security issue in 1.4.19. Django relies on user input in some cases (e.g. django.contrib.auth.views.login() and i18n) to redirect…","html":"<h1>Django 1.4.20 release notes<a class=\"heading-anchor\" href=\"#django-1-4-20-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>March 18, 2015</em></p>\n<p>Django 1.4.20 fixes one security issue in 1.4.19.</p>\n<section id=\"mitigated-possible-xss-attack-via-user-supplied-redirect-urls\">\n<h2>Mitigated possible XSS attack via user-supplied redirect URLs<a class=\"heading-anchor\" href=\"#mitigated-possible-xss-attack-via-user-supplied-redirect-urls\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django relies on user input in some cases (e.g.\n<code class=\"docutils literal notranslate\">django.contrib.auth.views.login()</code> and <a class=\"reference internal\" href=\"/en/dev/topics/i18n/\"><span class=\"doc\">i18n</span></a>)\nto redirect the user to an “on success” URL. The security checks for these\nredirects (namely <code class=\"docutils literal notranslate\">django.utils.http.is_safe_url()</code>) accepted URLs with\nleading control characters and so considered URLs like <code class=\"docutils literal notranslate\">\\x08javascript:...</code>\nsafe. This issue doesn’t affect Django currently, since we only put this URL\ninto the <code class=\"docutils literal notranslate\">Location</code> response header and browsers seem to ignore JavaScript\nthere. Browsers we tested also treat URLs prefixed with control characters such\nas <code class=\"docutils literal notranslate\">%08//example.com</code> as relative paths so redirection to an unsafe target\nisn’t a problem either.</p>\n<p>However, if a developer relies on <code class=\"docutils literal notranslate\">is_safe_url()</code> to\nprovide safe redirect targets and puts such a URL into a link, they could\nsuffer from an XSS attack as some browsers such as Google Chrome ignore control\ncharacters at the start of a URL in an anchor <code class=\"docutils literal notranslate\">href</code>.</p>\n</section>","rootId":"django-1-4-20-release-notes","toc":[{"title":"Mitigated possible XSS attack via user-supplied redirect URLs","anchor":"mitigated-possible-xss-attack-via-user-supplied-redirect-urls","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/1.4.21","title":"Django 1.4.21 release notes","url":"/en/dev/releases/1.4.21/"},"next":{"docname":"releases/1.4.19","title":"Django 1.4.19 release notes","url":"/en/dev/releases/1.4.19/"},"formats":{"html":"/en/dev/releases/1.4.20/","markdown":"/en/dev/releases/1.4.20.md","json":"/en/dev/releases/1.4.20.json"},"source":"https://github.com/django/django/blob/main/docs/releases/1.4.20.txt","official":"https://docs.djangoproject.com/en/dev/releases/1.4.20/","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"]}