{"title":"Django 4.0.1 release notes","version":"dev","locale":"en","docname":"releases/4.0.1","url":"/en/dev/releases/4.0.1/","canonical":"https://djangodocs.dev/en/dev/releases/4.0.1/","summary":"Django 4.0.1 fixes one security issue with severity “medium”, two security issues with severity “low”, and several bugs in 4.0.","html":"<h1>Django 4.0.1 release notes<a class=\"heading-anchor\" href=\"#django-4-0-1-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>January 4, 2022</em></p>\n<p>Django 4.0.1 fixes one security issue with severity “medium”, two security\nissues with severity “low”, and several bugs in 4.0.</p>\n<section id=\"cve-2021-45115-denial-of-service-possibility-in-userattributesimilarityvalidator\">\n<h2>CVE-2021-45115: Denial-of-service possibility in <code class=\"docutils literal notranslate\">UserAttributeSimilarityValidator</code><a class=\"heading-anchor\" href=\"#cve-2021-45115-denial-of-service-possibility-in-userattributesimilarityvalidator\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><a class=\"reference internal\" href=\"/en/dev/topics/auth/passwords/#django.contrib.auth.password_validation.UserAttributeSimilarityValidator\" title=\"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\"><code class=\"xref py py-class docutils literal notranslate\">UserAttributeSimilarityValidator</code></a> incurred significant overhead\nevaluating submitted password that were artificially large in relative to the\ncomparison values. On the assumption that access to user registration was\nunrestricted this provided a potential vector for a denial-of-service attack.</p>\n<p>In order to mitigate this issue, relatively long values are now ignored by\n<code class=\"docutils literal notranslate\">UserAttributeSimilarityValidator</code>.</p>\n<p>This issue has severity “medium” according to the <a class=\"reference internal\" href=\"/en/dev/internals/security/#severity-levels\"><span class=\"std std-ref\">Django security policy</span></a>.</p>\n</section>\n<section id=\"cve-2021-45116-potential-information-disclosure-in-dictsort-template-filter\">\n<h2>CVE-2021-45116: Potential information disclosure in <code class=\"docutils literal notranslate\">dictsort</code> template filter<a class=\"heading-anchor\" href=\"#cve-2021-45116-potential-information-disclosure-in-dictsort-template-filter\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Due to leveraging the Django Template Language’s variable resolution logic, the\n<a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-dictsort\"><code class=\"xref std std-tfilter docutils literal notranslate\">dictsort</code></a> template filter was potentially vulnerable to information\ndisclosure or unintended method calls, if passed a suitably crafted key.</p>\n<p>In order to avoid this possibility, <code class=\"docutils literal notranslate\">dictsort</code> now works with a restricted\nresolution logic, that will not call methods, nor allow indexing on\ndictionaries.</p>\n<p>As a reminder, all untrusted user input should be validated before use.</p>\n<p>This issue has severity “low” according to the <a class=\"reference internal\" href=\"/en/dev/internals/security/#severity-levels\"><span class=\"std std-ref\">Django security policy</span></a>.</p>\n</section>\n<section id=\"cve-2021-45452-potential-directory-traversal-via-storage-save\">\n<h2>CVE-2021-45452: Potential directory-traversal via <code class=\"docutils literal notranslate\">Storage.save()</code><a class=\"heading-anchor\" href=\"#cve-2021-45452-potential-directory-traversal-via-storage-save\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p><code class=\"docutils literal notranslate\">Storage.save()</code> allowed directory-traversal if directly passed suitably\ncrafted file names.</p>\n<p>This issue has severity “low” according to the <a class=\"reference internal\" href=\"/en/dev/internals/security/#severity-levels\"><span class=\"std std-ref\">Django security policy</span></a>.</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>Fixed a regression in Django 4.0 that caused a crash of\n<code class=\"docutils literal notranslate\">assertFormsetError()</code> on a formset named <code class=\"docutils literal notranslate\">form</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/33346\">#33346</a>).</p></li>\n<li><p>Fixed a bug in Django 4.0 that caused a crash on booleans with the\n<code class=\"docutils literal notranslate\">RedisCache</code> backend (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/33361\">#33361</a>).</p></li>\n<li><p>Relaxed the check added in Django 4.0 to reallow use of a duck-typed\n<code class=\"docutils literal notranslate\">HttpRequest</code> in <code class=\"docutils literal notranslate\">django.views.decorators.cache.cache_control()</code> and\n<code class=\"docutils literal notranslate\">never_cache()</code> decorators (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/33350\">#33350</a>).</p></li>\n<li><p>Fixed a regression in Django 4.0 that caused creating bogus migrations for\nmodels that reference swappable models such as <code class=\"docutils literal notranslate\">auth.User</code>\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/33366\">#33366</a>).</p></li>\n<li><p>Fixed a long standing bug in <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geos/#geos-geometry-collections\"><span class=\"std std-ref\">Geometry Collections</span></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geos/#django.contrib.gis.geos.Polygon\" title=\"django.contrib.gis.geos.Polygon\"><code class=\"xref py py-class docutils literal notranslate\">Polygon</code></a> that caused a crash on some\nplatforms (reported on macOS based on the <code class=\"docutils literal notranslate\">ARM64</code> architecture)\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/32600\">#32600</a>).</p></li>\n</ul>\n</section>","rootId":"django-4-0-1-release-notes","toc":[{"title":"CVE-2021-45115: Denial-of-service possibility in UserAttributeSimilarityValidator","anchor":"cve-2021-45115-denial-of-service-possibility-in-userattributesimilarityvalidator","children":[]},{"title":"CVE-2021-45116: Potential information disclosure in dictsort template filter","anchor":"cve-2021-45116-potential-information-disclosure-in-dictsort-template-filter","children":[]},{"title":"CVE-2021-45452: Potential directory-traversal via Storage.save()","anchor":"cve-2021-45452-potential-directory-traversal-via-storage-save","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/4.0.2","title":"Django 4.0.2 release notes","url":"/en/dev/releases/4.0.2/"},"next":{"docname":"releases/4.0","title":"Django 4.0 release notes","url":"/en/dev/releases/4.0/"},"formats":{"html":"/en/dev/releases/4.0.1/","markdown":"/en/dev/releases/4.0.1.md","json":"/en/dev/releases/4.0.1.json"},"source":"https://github.com/django/django/blob/main/docs/releases/4.0.1.txt","official":"https://docs.djangoproject.com/en/dev/releases/4.0.1/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0"],"inLocales":["en"]}