{"title":"Django 5.2.9 release notes","version":"dev","locale":"en","docname":"releases/5.2.9","url":"/en/dev/releases/5.2.9/","canonical":"https://djangodocs.dev/en/dev/releases/5.2.9/","summary":"Django 5.2.9 fixes one security issue with severity “high”, one security issue with severity “moderate”, and several bugs in 5.2.8.","html":"<h1>Django 5.2.9 release notes<a class=\"heading-anchor\" href=\"#django-5-2-9-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>December 2, 2025</em></p>\n<p>Django 5.2.9 fixes one security issue with severity “high”, one security issue\nwith severity “moderate”, and several bugs in 5.2.8.</p>\n<section id=\"cve-2025-13372-potential-sql-injection-in-filteredrelation-column-aliases-on-postgresql\">\n<h2>CVE-2025-13372: Potential SQL injection in <code class=\"docutils literal notranslate\">FilteredRelation</code> column aliases on PostgreSQL<a class=\"heading-anchor\" href=\"#cve-2025-13372-potential-sql-injection-in-filteredrelation-column-aliases-on-postgresql\"><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/models/querysets/#django.db.models.FilteredRelation\" title=\"django.db.models.FilteredRelation\"><code class=\"xref py py-class docutils literal notranslate\">FilteredRelation</code></a> was subject to SQL injection in column aliases,\nusing a suitably crafted dictionary, with dictionary expansion, as the\n<code class=\"docutils literal notranslate\">**kwargs</code> passed to <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.annotate\" title=\"django.db.models.query.QuerySet.annotate\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.annotate()</code></a> or <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.alias\" title=\"django.db.models.query.QuerySet.alias\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.alias()</code></a> on\nPostgreSQL.</p>\n</section>\n<section id=\"cve-2025-64460-potential-denial-of-service-vulnerability-in-xml-deserializer\">\n<h2>CVE-2025-64460: Potential denial-of-service vulnerability in XML <code class=\"docutils literal notranslate\">Deserializer</code><a class=\"heading-anchor\" href=\"#cve-2025-64460-potential-denial-of-service-vulnerability-in-xml-deserializer\"><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/serialization/#serialization-formats-xml\"><span class=\"std std-ref\">XML Serialization</span></a> was subject to a potential\ndenial-of-service attack due to quadratic time complexity when deserializing\ncrafted documents containing many nested invalid elements. The internal helper\n<code class=\"docutils literal notranslate\">django.core.serializers.xml_serializer.getInnerText()</code> previously\naccumulated inner text inefficiently during recursion. It now collects text per\nelement, avoiding excessive resource usage.</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.2 where\n<code class=\"docutils literal notranslate\">django.utils.feedgenerator.Stylesheet.__str__()</code> did not escape\nthe <code class=\"docutils literal notranslate\">url</code>, <code class=\"docutils literal notranslate\">mimetype</code>, and <code class=\"docutils literal notranslate\">media</code> attributes, potentially leading\nto invalid XML markup (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36733\">#36733</a>).</p></li>\n<li><p>Fixed a bug in Django 5.2 on PostgreSQL where <code class=\"docutils literal notranslate\">bulk_create()</code> did not apply\na field’s custom query placeholders (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36748\">#36748</a>).</p></li>\n<li><p>Fixed a regression in Django 5.2.2 that caused a crash when using aggregate\nfunctions with an empty <code class=\"docutils literal notranslate\">Q</code> filter over a queryset with annotations\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36751\">#36751</a>).</p></li>\n<li><p>Fixed a regression in Django 5.2.8 where <code class=\"docutils literal notranslate\">DisallowedRedirect</code> was raised by\n<a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponseRedirect\" title=\"django.http.HttpResponseRedirect\"><code class=\"xref py py-class docutils literal notranslate\">HttpResponseRedirect</code></a> and\n<a class=\"reference internal\" href=\"/en/dev/ref/request-response/#django.http.HttpResponsePermanentRedirect\" title=\"django.http.HttpResponsePermanentRedirect\"><code class=\"xref py py-class docutils literal notranslate\">HttpResponsePermanentRedirect</code></a> for URLs longer than 2048\ncharacters. The limit is now 16384 characters (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36743\">#36743</a>).</p></li>\n<li><p>Fixed a crash on Python 3.14+ that prevented template tag functions from\nbeing registered when their type annotations required deferred evaluation\n(<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36712\">#36712</a>).</p></li>\n</ul>\n</section>","rootId":"django-5-2-9-release-notes","toc":[{"title":"CVE-2025-13372: Potential SQL injection in FilteredRelation column aliases on PostgreSQL","anchor":"cve-2025-13372-potential-sql-injection-in-filteredrelation-column-aliases-on-postgresql","children":[]},{"title":"CVE-2025-64460: Potential denial-of-service vulnerability in XML Deserializer","anchor":"cve-2025-64460-potential-denial-of-service-vulnerability-in-xml-deserializer","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/5.2.10","title":"Django 5.2.10 release notes","url":"/en/dev/releases/5.2.10/"},"next":{"docname":"releases/5.2.8","title":"Django 5.2.8 release notes","url":"/en/dev/releases/5.2.8/"},"formats":{"html":"/en/dev/releases/5.2.9/","markdown":"/en/dev/releases/5.2.9.md","json":"/en/dev/releases/5.2.9.json"},"source":"https://github.com/django/django/blob/main/docs/releases/5.2.9.txt","official":"https://docs.djangoproject.com/en/dev/releases/5.2.9/","inVersions":["dev","6.1","6.0","5.2"],"inLocales":["en"]}