{"title":"Django 3.1.1 release notes","version":"dev","locale":"en","docname":"releases/3.1.1","url":"/en/dev/releases/3.1.1/","canonical":"https://djangodocs.dev/en/dev/releases/3.1.1/","summary":"Django 3.1.1 fixes two security issues and several bugs in 3.1. On Python 3.7+, FILE_UPLOAD_DIRECTORY_PERMISSIONS mode was not applied to intermediate-level…","html":"<h1>Django 3.1.1 release notes<a class=\"heading-anchor\" href=\"#django-3-1-1-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>September 1, 2020</em></p>\n<p>Django 3.1.1 fixes two security issues and several bugs in 3.1.</p>\n<section id=\"cve-2020-24583-incorrect-permissions-on-intermediate-level-directories-on-python-3-7\">\n<h2>CVE-2020-24583: Incorrect permissions on intermediate-level directories on Python 3.7+<a class=\"heading-anchor\" href=\"#cve-2020-24583-incorrect-permissions-on-intermediate-level-directories-on-python-3-7\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>On Python 3.7+, <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-FILE_UPLOAD_DIRECTORY_PERMISSIONS\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_UPLOAD_DIRECTORY_PERMISSIONS</code></a> mode was not\napplied to intermediate-level directories created in the process of uploading\nfiles and to intermediate-level collected static directories when using the\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">collectstatic</code></a> management command.</p>\n<p>You should review and manually fix permissions on existing intermediate-level\ndirectories.</p>\n</section>\n<section id=\"cve-2020-24584-permission-escalation-in-intermediate-level-directories-of-the-file-system-cache-on-python-3-7\">\n<h2>CVE-2020-24584: Permission escalation in intermediate-level directories of the file system cache on Python 3.7+<a class=\"heading-anchor\" href=\"#cve-2020-24584-permission-escalation-in-intermediate-level-directories-of-the-file-system-cache-on-python-3-7\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>On Python 3.7+, the intermediate-level directories of the file system cache had\nthe system’s standard umask rather than <code class=\"docutils literal notranslate\">0o077</code> (no group or others\npermissions).</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 wrapping of translated action labels in the admin’s navigation sidebar\nfor East Asian languages (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31853\">#31853</a>).</p></li>\n<li><p>Fixed wrapping of long model names in the admin’s navigation sidebar\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31854\">#31854</a>).</p></li>\n<li><p>Fixed encoding session data while upgrading multiple instances of the same\nproject to Django 3.1 (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31864\">#31864</a>).</p></li>\n<li><p>Adjusted admin’s navigation sidebar template to reduce debug logging when\nrendering (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31865\">#31865</a>).</p></li>\n<li><p>Fixed a data loss possibility in the\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.select_for_update\" title=\"django.db.models.query.QuerySet.select_for_update\"><code class=\"xref py py-meth docutils literal notranslate\">select_for_update()</code></a>. When using\nrelated fields pointing to a proxy model in the <code class=\"docutils literal notranslate\">of</code> argument, the\ncorresponding model was not locked (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31866\">#31866</a>).</p></li>\n<li><p>Fixed a data loss possibility, following a regression in Django 2.0, when\ncopying model instances with a cached fields value (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31863\">#31863</a>).</p></li>\n<li><p>Fixed a regression in Django 3.1 that caused a crash when decoding an invalid\nsession data (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31895\">#31895</a>).</p></li>\n<li><p>Reverted a deprecation in Django 3.1 that caused a crash when passing\ndeprecated keyword arguments to a queryset in\n<code class=\"docutils literal notranslate\">TemplateView.get_context_data()</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31877\">#31877</a>).</p></li>\n<li><p>Enforced thread sensitivity of the <a class=\"reference internal\" href=\"/en/dev/topics/http/middleware/#django.middleware.MiddlewareMixin\" title=\"django.middleware.MiddlewareMixin\"><code class=\"xref py py-class docutils literal notranslate\">MiddlewareMixin.process_request()</code></a> and <code class=\"docutils literal notranslate\">process_response()</code> hooks\nwhen in an async context (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31905\">#31905</a>).</p></li>\n<li><p>Fixed <code class=\"docutils literal notranslate\">__in</code> lookup on key transforms for\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.JSONField\" title=\"django.db.models.JSONField\"><code class=\"xref py py-class docutils literal notranslate\">JSONField</code></a> with MariaDB, MySQL, Oracle, and SQLite\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31936\">#31936</a>).</p></li>\n<li><p>Fixed a regression in Django 3.1 that caused permission errors in\n<code class=\"docutils literal notranslate\">CommonPasswordValidator</code> and <code class=\"docutils literal notranslate\">settings.py</code> generated by the\n<a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">startproject</code></a> command, when user didn’t have permissions to all\nintermediate directories in a Django installation path (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31912\">#31912</a>).</p></li>\n<li><p>Fixed detecting an async <code class=\"docutils literal notranslate\">get_response</code> callable in various builtin\nmiddlewares (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31928\">#31928</a>).</p></li>\n<li><p>Fixed a <code class=\"docutils literal notranslate\">QuerySet.order_by()</code> crash on PostgreSQL when ordering and\ngrouping by <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.JSONField\" title=\"django.db.models.JSONField\"><code class=\"xref py py-class docutils literal notranslate\">JSONField</code></a> with a custom\n<a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.JSONField.decoder\" title=\"django.db.models.JSONField.decoder\"><code class=\"xref py py-attr docutils literal notranslate\">decoder</code></a> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31956\">#31956</a>). As a\nconsequence, fetching a <code class=\"docutils literal notranslate\">JSONField</code> with raw SQL now returns a string\ninstead of preloaded data. You will need to explicitly call <code class=\"docutils literal notranslate\">json.loads()</code>\nin such cases.</p></li>\n<li><p>Fixed a <code class=\"docutils literal notranslate\">QuerySet.delete()</code> crash on MySQL, following a performance\nregression in Django 3.1 on MariaDB 10.3.2+, when filtering against an\naggregate function (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31965\">#31965</a>).</p></li>\n<li><p>Fixed a <code class=\"docutils literal notranslate\">django.contrib.admin.EmptyFieldListFilter</code> crash when using on\nreverse relations (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31952\">#31952</a>).</p></li>\n<li><p>Prevented content overflowing in the admin changelist view when the\nnavigation sidebar is enabled (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/31901\">#31901</a>).</p></li>\n</ul>\n</section>","rootId":"django-3-1-1-release-notes","toc":[{"title":"CVE-2020-24583: Incorrect permissions on intermediate-level directories on Python 3.7+","anchor":"cve-2020-24583-incorrect-permissions-on-intermediate-level-directories-on-python-3-7","children":[]},{"title":"CVE-2020-24584: Permission escalation in intermediate-level directories of the file system cache on Python 3.7+","anchor":"cve-2020-24584-permission-escalation-in-intermediate-level-directories-of-the-file-system-cache-on-python-3-7","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/3.1.2","title":"Django 3.1.2 release notes","url":"/en/dev/releases/3.1.2/"},"next":{"docname":"releases/3.1","title":"Django 3.1 release notes","url":"/en/dev/releases/3.1/"},"formats":{"html":"/en/dev/releases/3.1.1/","markdown":"/en/dev/releases/3.1.1.md","json":"/en/dev/releases/3.1.1.json"},"source":"https://github.com/django/django/blob/main/docs/releases/3.1.1.txt","official":"https://docs.djangoproject.com/en/dev/releases/3.1.1/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1"],"inLocales":["en"]}