{"title":"Django 5.2.12 release notes","version":"dev","locale":"en","docname":"releases/5.2.12","url":"/en/dev/releases/5.2.12/","canonical":"https://djangodocs.dev/en/dev/releases/5.2.12/","summary":"Django 5.2.12 fixes a security issue with severity “moderate” and a security issue with severity “low” in 5.2.11.","html":"<h1>Django 5.2.12 release notes<a class=\"heading-anchor\" href=\"#django-5-2-12-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>March 3, 2026</em></p>\n<p>Django 5.2.12 fixes a security issue with severity “moderate” and a security\nissue with severity “low” in 5.2.11. It also fixes one bug related to support\nfor Python 3.14.</p>\n<section id=\"cve-2026-25673-potential-denial-of-service-vulnerability-in-urlfield-via-unicode-normalization-on-windows\">\n<h2>CVE-2026-25673: Potential denial-of-service vulnerability in <code class=\"docutils literal notranslate\">URLField</code> via Unicode normalization on Windows<a class=\"heading-anchor\" href=\"#cve-2026-25673-potential-denial-of-service-vulnerability-in-urlfield-via-unicode-normalization-on-windows\"><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/forms/fields/#django.forms.URLField\" title=\"django.forms.URLField\"><code class=\"xref py py-class docutils literal notranslate\">URLField</code></a> form field’s <code class=\"docutils literal notranslate\">to_python()</code> method used\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlsplit\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">urlsplit()</code></a> to determine whether to prepend a URL scheme to\nthe submitted value. On Windows, <code class=\"docutils literal notranslate\">urlsplit()</code> performs\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/unicodedata.html#unicodedata.normalize\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">NFKC normalization</code></a>, which can be\ndisproportionately slow for large inputs containing certain characters.</p>\n<p><code class=\"docutils literal notranslate\">URLField.to_python()</code> now uses a simplified scheme detection, avoiding\nUnicode normalization entirely and deferring URL validation to the appropriate\nlayers. As a result, while leading and trailing whitespace is still stripped by\ndefault, characters such as newlines, tabs, and other control characters within\nthe value are no longer handled by <code class=\"docutils literal notranslate\">URLField.to_python()</code>. When using the\ndefault <a class=\"reference internal\" href=\"/en/dev/ref/validators/#django.core.validators.URLValidator\" title=\"django.core.validators.URLValidator\"><code class=\"xref py py-class docutils literal notranslate\">URLValidator</code></a>, these values will\ncontinue to raise <a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.ValidationError\" title=\"django.core.exceptions.ValidationError\"><code class=\"xref py py-exc docutils literal notranslate\">ValidationError</code></a> during\nvalidation, but if you rely on custom validators, ensure they do not depend on\nthe previous behavior of <code class=\"docutils literal notranslate\">URLField.to_python()</code>.</p>\n<p>This issue has severity “moderate” according to the <a class=\"reference internal\" href=\"/en/dev/internals/security/#severity-levels\"><span class=\"std std-ref\">Django security\npolicy</span></a>.</p>\n</section>\n<section id=\"cve-2026-25674-potential-incorrect-permissions-on-newly-created-file-system-objects\">\n<h2>CVE-2026-25674: Potential incorrect permissions on newly created file system objects<a class=\"heading-anchor\" href=\"#cve-2026-25674-potential-incorrect-permissions-on-newly-created-file-system-objects\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Django’s file-system storage and file-based cache backends used the process\n<code class=\"docutils literal notranslate\">umask</code> to control permissions when creating directories. In multi-threaded\nenvironments, one thread’s temporary umask change can affect other threads’\nfile and directory creation, resulting in file system objects being created\nwith unintended permissions.</p>\n<p>Django now applies the requested permissions via <a class=\"reference external\" href=\"https://docs.python.org/3/library/os.html#os.chmod\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">chmod()</code></a> after\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/os.html#os.mkdir\" title=\"(in Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">mkdir()</code></a>, removing the dependency on the process-wide umask.</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 class=\"reference external\" href=\"https://docs.python.org/3/library/exceptions.html#NameError\" title=\"(in Python v3.14)\"><code class=\"xref py py-exc docutils literal notranslate\">NameError</code></a> when inspecting functions making use of deferred\nannotations in Python 3.14 (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36903\">#36903</a>).</p></li>\n</ul>\n</section>","rootId":"django-5-2-12-release-notes","toc":[{"title":"CVE-2026-25673: Potential denial-of-service vulnerability in URLField via Unicode normalization on Windows","anchor":"cve-2026-25673-potential-denial-of-service-vulnerability-in-urlfield-via-unicode-normalization-on-windows","children":[]},{"title":"CVE-2026-25674: Potential incorrect permissions on newly created file system objects","anchor":"cve-2026-25674-potential-incorrect-permissions-on-newly-created-file-system-objects","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/5.2.13","title":"Django 5.2.13 release notes","url":"/en/dev/releases/5.2.13/"},"next":{"docname":"releases/5.2.11","title":"Django 5.2.11 release notes","url":"/en/dev/releases/5.2.11/"},"formats":{"html":"/en/dev/releases/5.2.12/","markdown":"/en/dev/releases/5.2.12.md","json":"/en/dev/releases/5.2.12.json"},"source":"https://github.com/django/django/blob/main/docs/releases/5.2.12.txt","official":"https://docs.djangoproject.com/en/dev/releases/5.2.12/","inVersions":["dev","6.1","6.0","5.2"],"inLocales":["en"]}