{"title":"Django 5.0.7 release notes","version":"dev","locale":"en","docname":"releases/5.0.7","url":"/en/dev/releases/5.0.7/","canonical":"https://djangodocs.dev/en/dev/releases/5.0.7/","summary":"Django 5.0.7 fixes two security issues with severity “moderate”, two security issues with severity “low”, and one bug in 5.0.6.","html":"<h1>Django 5.0.7 release notes<a class=\"heading-anchor\" href=\"#django-5-0-7-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>July 9, 2024</em></p>\n<p>Django 5.0.7 fixes two security issues with severity “moderate”, two security\nissues with severity “low”, and one bug in 5.0.6.</p>\n<section id=\"cve-2024-38875-potential-denial-of-service-vulnerability-in-django-utils-html-urlize\">\n<h2>CVE-2024-38875: Potential denial-of-service vulnerability in <code class=\"docutils literal notranslate\">django.utils.html.urlize()</code><a class=\"heading-anchor\" href=\"#cve-2024-38875-potential-denial-of-service-vulnerability-in-django-utils-html-urlize\"><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/ref/templates/builtins/#std-templatefilter-urlize\"><code class=\"xref std std-tfilter docutils literal notranslate\">urlize</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-urlizetrunc\"><code class=\"xref std std-tfilter docutils literal notranslate\">urlizetrunc</code></a> were subject to a potential\ndenial-of-service attack via certain inputs with a very large number of\nbrackets.</p>\n</section>\n<section id=\"cve-2024-39329-username-enumeration-through-timing-difference-for-users-with-unusable-passwords\">\n<h2>CVE-2024-39329: Username enumeration through timing difference for users with unusable passwords<a class=\"heading-anchor\" href=\"#cve-2024-39329-username-enumeration-through-timing-difference-for-users-with-unusable-passwords\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The <a class=\"reference internal\" href=\"/en/dev/ref/contrib/auth/#django.contrib.auth.backends.ModelBackend.authenticate\" title=\"django.contrib.auth.backends.ModelBackend.authenticate\"><code class=\"xref py py-meth docutils literal notranslate\">authenticate()</code></a> method\nallowed remote attackers to enumerate users via a timing attack involving login\nrequests for users with unusable passwords.</p>\n</section>\n<section id=\"cve-2024-39330-potential-directory-traversal-via-storage-save\">\n<h2>CVE-2024-39330: Potential directory-traversal via <code class=\"docutils literal notranslate\">Storage.save()</code><a class=\"heading-anchor\" href=\"#cve-2024-39330-potential-directory-traversal-via-storage-save\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Derived classes of the <a class=\"reference internal\" href=\"/en/dev/ref/files/storage/#django.core.files.storage.Storage\" title=\"django.core.files.storage.Storage\"><code class=\"xref py py-class docutils literal notranslate\">Storage</code></a> base class\nwhich override <a class=\"reference internal\" href=\"/en/dev/ref/files/storage/#django.core.files.storage.Storage.generate_filename\" title=\"django.core.files.storage.Storage.generate_filename\"><code class=\"xref py py-meth docutils literal notranslate\">generate_filename()</code></a> without replicating\nthe file path validations existing in the parent class, allowed for potential\ndirectory-traversal via certain inputs when calling <a class=\"reference internal\" href=\"/en/dev/ref/files/storage/#django.core.files.storage.Storage.save\" title=\"django.core.files.storage.Storage.save\"><code class=\"xref py py-meth docutils literal notranslate\">save()</code></a>.</p>\n<p>Built-in <code class=\"docutils literal notranslate\">Storage</code> sub-classes were not affected by this vulnerability.</p>\n</section>\n<section id=\"cve-2024-39614-potential-denial-of-service-vulnerability-in-get-supported-language-variant\">\n<h2>CVE-2024-39614: Potential denial-of-service vulnerability in <code class=\"docutils literal notranslate\">get_supported_language_variant()</code><a class=\"heading-anchor\" href=\"#cve-2024-39614-potential-denial-of-service-vulnerability-in-get-supported-language-variant\"><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/ref/utils/#django.utils.translation.get_supported_language_variant\" title=\"django.utils.translation.get_supported_language_variant\"><code class=\"xref py py-meth docutils literal notranslate\">get_supported_language_variant()</code></a> was subject to\na potential denial-of-service attack when used with very long strings\ncontaining specific characters.</p>\n<p>To mitigate this vulnerability, the language code provided to\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.translation.get_supported_language_variant\" title=\"django.utils.translation.get_supported_language_variant\"><code class=\"xref py py-meth docutils literal notranslate\">get_supported_language_variant()</code></a> is now parsed\nup to a maximum length of 500 characters.</p>\n<p>When the language code is over 500 characters, a <a class=\"reference external\" href=\"https://docs.python.org/3/library/exceptions.html#ValueError\" title=\"(in Python v3.14)\"><code class=\"xref py py-exc docutils literal notranslate\">ValueError</code></a> will now be\nraised if <code class=\"docutils literal notranslate\">strict</code> is <code class=\"docutils literal notranslate\">True</code>, or if there is no generic variant and\n<code class=\"docutils literal notranslate\">strict</code> is <code class=\"docutils literal notranslate\">False</code>.</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 bug in Django 5.0 that caused a crash of <code class=\"docutils literal notranslate\">Model.full_clean()</code> on\nunsaved model instances with a <code class=\"docutils literal notranslate\">GeneratedField</code> and certain defined\n<a class=\"reference internal\" href=\"/en/dev/ref/models/options/#django.db.models.Options.constraints\" title=\"django.db.models.Options.constraints\"><code class=\"xref py py-attr docutils literal notranslate\">Meta.constraints</code></a>\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/35560\">#35560</a>).</p></li>\n</ul>\n</section>","rootId":"django-5-0-7-release-notes","toc":[{"title":"CVE-2024-38875: Potential denial-of-service vulnerability in django.utils.html.urlize()","anchor":"cve-2024-38875-potential-denial-of-service-vulnerability-in-django-utils-html-urlize","children":[]},{"title":"CVE-2024-39329: Username enumeration through timing difference for users with unusable passwords","anchor":"cve-2024-39329-username-enumeration-through-timing-difference-for-users-with-unusable-passwords","children":[]},{"title":"CVE-2024-39330: Potential directory-traversal via Storage.save()","anchor":"cve-2024-39330-potential-directory-traversal-via-storage-save","children":[]},{"title":"CVE-2024-39614: Potential denial-of-service vulnerability in get_supported_language_variant()","anchor":"cve-2024-39614-potential-denial-of-service-vulnerability-in-get-supported-language-variant","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/5.0.8","title":"Django 5.0.8 release notes","url":"/en/dev/releases/5.0.8/"},"next":{"docname":"releases/5.0.6","title":"Django 5.0.6 release notes","url":"/en/dev/releases/5.0.6/"},"formats":{"html":"/en/dev/releases/5.0.7/","markdown":"/en/dev/releases/5.0.7.md","json":"/en/dev/releases/5.0.7.json"},"source":"https://github.com/django/django/blob/main/docs/releases/5.0.7.txt","official":"https://docs.djangoproject.com/en/dev/releases/5.0.7/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0"],"inLocales":["en"]}