{"title":"Django 3.2.1 release notes","version":"dev","locale":"en","docname":"releases/3.2.1","url":"/en/dev/releases/3.2.1/","canonical":"https://djangodocs.dev/en/dev/releases/3.2.1/","summary":"Django 3.2.1 fixes a security issue and several bugs in 3.2. MultiPartParser, UploadedFile, and FieldFile allowed directory-traversal via uploaded files…","html":"<h1>Django 3.2.1 release notes<a class=\"heading-anchor\" href=\"#django-3-2-1-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>May 4, 2021</em></p>\n<p>Django 3.2.1 fixes a security issue and several bugs in 3.2.</p>\n<section id=\"cve-2021-31542-potential-directory-traversal-via-uploaded-files\">\n<h2>CVE-2021-31542: Potential directory-traversal via uploaded files<a class=\"heading-anchor\" href=\"#cve-2021-31542-potential-directory-traversal-via-uploaded-files\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><code class=\"docutils literal notranslate\">MultiPartParser</code>, <code class=\"docutils literal notranslate\">UploadedFile</code>, and <code class=\"docutils literal notranslate\">FieldFile</code> allowed\ndirectory-traversal via uploaded files with suitably crafted file names.</p>\n<p>In order to mitigate this risk, stricter basename and path sanitation is now\napplied.</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>Corrected detection of GDAL 3.2 on Windows (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32544\">#32544</a>).</p></li>\n<li><p>Fixed a bug in Django 3.2 where subclasses of <code class=\"docutils literal notranslate\">BigAutoField</code> and\n<code class=\"docutils literal notranslate\">SmallAutoField</code> were not allowed for the <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DEFAULT_AUTO_FIELD\"><code class=\"xref std std-setting docutils literal notranslate\">DEFAULT_AUTO_FIELD</code></a>\nsetting (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32620\">#32620</a>).</p></li>\n<li><p>Fixed a regression in Django 3.2 that caused a crash of\n<code class=\"docutils literal notranslate\">QuerySet.values()/values_list()</code> after <code class=\"docutils literal notranslate\">QuerySet.union()</code>,\n<code class=\"docutils literal notranslate\">intersection()</code>, and <code class=\"docutils literal notranslate\">difference()</code> when it was ordered by an\nunannotated field (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32627\">#32627</a>).</p></li>\n<li><p>Restored, following a regression in Django 3.2, displaying an exception\nmessage on the technical 404 debug page (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32637\">#32637</a>).</p></li>\n<li><p>Fixed a bug in Django 3.2 where a system check would crash on a reverse\none-to-one relationships in <code class=\"docutils literal notranslate\">CheckConstraint.check</code> or\n<code class=\"docutils literal notranslate\">UniqueConstraint.condition</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32635\">#32635</a>).</p></li>\n<li><p>Fixed a regression in Django 3.2 that caused a crash of\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields\" title=\"django.contrib.admin.ModelAdmin.search_fields\"><code class=\"xref py py-attr docutils literal notranslate\">ModelAdmin.search_fields</code></a> when searching against phrases with\nunbalanced quotes (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32649\">#32649</a>).</p></li>\n<li><p>Fixed a bug in Django 3.2 where variable lookup errors were logged rendering\nthe sitemap template if alternates were not defined (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32648\">#32648</a>).</p></li>\n<li><p>Fixed a regression in Django 3.2 that caused a crash when combining <code class=\"docutils literal notranslate\">Q()</code>\nobjects which contains boolean expressions (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32548\">#32548</a>).</p></li>\n<li><p>Fixed a regression in Django 3.2 that caused a crash of <code class=\"docutils literal notranslate\">QuerySet.update()</code>\non a queryset ordered by inherited or joined fields on MySQL and MariaDB\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32645\">#32645</a>).</p></li>\n<li><p>Fixed a regression in Django 3.2 that caused a crash when decoding a cookie\nvalue, used by <code class=\"docutils literal notranslate\">django.contrib.messages.storage.cookie.CookieStorage</code>, in\nthe pre-Django 3.2 format (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32643\">#32643</a>).</p></li>\n<li><p>Fixed a regression in Django 3.2 that stopped the shift-key modifier\nselecting multiple rows in the admin changelist (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32647\">#32647</a>).</p></li>\n<li><p>Fixed a bug in Django 3.2 where a system check would crash on the\n<a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-STATICFILES_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">STATICFILES_DIRS</code></a> setting with a list of 2-tuples of\n<code class=\"docutils literal notranslate\">(prefix, path)</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32665\">#32665</a>).</p></li>\n<li><p>Fixed a long standing bug involving queryset bitwise combination when used\nwith subqueries that began manifesting in Django 3.2, due to a separate fix\nusing <code class=\"docutils literal notranslate\">Exists</code> to <code class=\"docutils literal notranslate\">exclude()</code> multi-valued relationships\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32650\">#32650</a>).</p></li>\n<li><p>Fixed a bug in Django 3.2 where variable lookup errors were logged when\nrendering some admin templates (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32681\">#32681</a>).</p></li>\n<li><p>Fixed a bug in Django 3.2 where an admin changelist would crash when deleting\nobjects filtered against multi-valued relationships (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32682\">#32682</a>). The\nadmin changelist now uses <code class=\"docutils literal notranslate\">Exists()</code> instead of <code class=\"docutils literal notranslate\">QuerySet.distinct()</code>\nbecause calling <code class=\"docutils literal notranslate\">delete()</code> after <code class=\"docutils literal notranslate\">distinct()</code> is not allowed in Django\n3.2 to address a data loss possibility.</p></li>\n<li><p>Fixed a regression in Django 3.2 where the calling process environment would\nnot be passed to the <code class=\"docutils literal notranslate\">dbshell</code> command on PostgreSQL (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32687\">#32687</a>).</p></li>\n<li><p>Fixed a performance regression in Django 3.2 when building complex filters\nwith subqueries (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32632\">#32632</a>). As a side-effect the private API to check\n<code class=\"docutils literal notranslate\">django.db.sql.query.Query</code> equality is removed.</p></li>\n</ul>\n</section>","rootId":"django-3-2-1-release-notes","toc":[{"title":"CVE-2021-31542: Potential directory-traversal via uploaded files","anchor":"cve-2021-31542-potential-directory-traversal-via-uploaded-files","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/3.2.2","title":"Django 3.2.2 release notes","url":"/en/dev/releases/3.2.2/"},"next":{"docname":"releases/3.2","title":"Django 3.2 release notes","url":"/en/dev/releases/3.2/"},"formats":{"html":"/en/dev/releases/3.2.1/","markdown":"/en/dev/releases/3.2.1.md","json":"/en/dev/releases/3.2.1.json"},"source":"https://github.com/django/django/blob/main/docs/releases/3.2.1.txt","official":"https://docs.djangoproject.com/en/dev/releases/3.2.1/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2"],"inLocales":["en"]}