{"title":"Django 5.2.7 release notes","version":"dev","locale":"en","docname":"releases/5.2.7","url":"/en/dev/releases/5.2.7/","canonical":"https://djangodocs.dev/en/dev/releases/5.2.7/","summary":"Django 5.2.7 fixes one security issue with severity “high”, one security issue with severity “low”, and one bug in 5.2.6.","html":"<h1>Django 5.2.7 release notes<a class=\"heading-anchor\" href=\"#django-5-2-7-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>October 1, 2025</em></p>\n<p>Django 5.2.7 fixes one security issue with severity “high”, one security issue\nwith severity “low”, and one bug in 5.2.6. Also, the latest string translations\nfrom Transifex are incorporated.</p>\n<section id=\"cve-2025-59681-potential-sql-injection-in-queryset-annotate-alias-aggregate-and-extra-on-mysql-and-mariadb\">\n<h2>CVE-2025-59681: Potential SQL injection in <code class=\"docutils literal notranslate\">QuerySet.annotate()</code>, <code class=\"docutils literal notranslate\">alias()</code>, <code class=\"docutils literal notranslate\">aggregate()</code>, and <code class=\"docutils literal notranslate\">extra()</code> on MySQL and MariaDB<a class=\"heading-anchor\" href=\"#cve-2025-59681-potential-sql-injection-in-queryset-annotate-alias-aggregate-and-extra-on-mysql-and-mariadb\"><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.query.QuerySet.annotate\" title=\"django.db.models.query.QuerySet.annotate\"><code class=\"xref py py-meth docutils literal notranslate\">QuerySet.annotate()</code></a>, <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\">alias()</code></a>,\n<a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.aggregate\" title=\"django.db.models.query.QuerySet.aggregate\"><code class=\"xref py py-meth docutils literal notranslate\">aggregate()</code></a>, and <a class=\"reference internal\" href=\"/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.extra\" title=\"django.db.models.query.QuerySet.extra\"><code class=\"xref py py-meth docutils literal notranslate\">extra()</code></a> methods were subject\nto SQL injection in column aliases, using a suitably crafted dictionary, with\ndictionary expansion, as the <code class=\"docutils literal notranslate\">**kwargs</code> passed to these methods (follow up to\n<span class=\"target\" id=\"index-0\"></span><a class=\"cve reference external\" href=\"https://www.cve.org/CVERecord?id=CVE-2022-28346\"><strong>CVE 2022-28346</strong></a>).</p>\n</section>\n<section id=\"cve-2025-59682-potential-partial-directory-traversal-via-archive-extract\">\n<h2>CVE-2025-59682: Potential partial directory-traversal via <code class=\"docutils literal notranslate\">archive.extract()</code><a class=\"heading-anchor\" href=\"#cve-2025-59682-potential-partial-directory-traversal-via-archive-extract\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The <code class=\"docutils literal notranslate\">django.utils.archive.extract()</code> function, used by\n<a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-startapp-template\"><code class=\"xref std std-option docutils literal notranslate\">startapp --template</code></a> and <a class=\"reference internal\" href=\"/en/dev/ref/django-admin/#cmdoption-startproject-template\"><code class=\"xref std std-option docutils literal notranslate\">startproject --template</code></a>, allowed\npartial directory-traversal via an archive with file paths sharing a common\nprefix with the target directory (follow up to <span class=\"target\" id=\"index-1\"></span><a class=\"cve reference external\" href=\"https://www.cve.org/CVERecord?id=CVE-2021-3281\"><strong>CVE 2021-3281</strong></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 5.2 that reduced the color contrast of\nthe chosen label of <code class=\"docutils literal notranslate\">filter_horizontal</code> and <code class=\"docutils literal notranslate\">filter_vertical</code> widgets\nwithin a <code class=\"docutils literal notranslate\">TabularInline</code> (<a class=\"extlink-ticket reference external\" href=\"https://code.djangoproject.com/ticket/36601\">#36601</a>).</p></li>\n</ul>\n</section>","rootId":"django-5-2-7-release-notes","toc":[{"title":"CVE-2025-59681: Potential SQL injection in QuerySet.annotate(), alias(), aggregate(), and extra() on MySQL and MariaDB","anchor":"cve-2025-59681-potential-sql-injection-in-queryset-annotate-alias-aggregate-and-extra-on-mysql-and-mariadb","children":[]},{"title":"CVE-2025-59682: Potential partial directory-traversal via archive.extract()","anchor":"cve-2025-59682-potential-partial-directory-traversal-via-archive-extract","children":[]},{"title":"Bugfixes","anchor":"bugfixes","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/5.2.8","title":"Django 5.2.8 release notes","url":"/en/dev/releases/5.2.8/"},"next":{"docname":"releases/5.2.6","title":"Django 5.2.6 release notes","url":"/en/dev/releases/5.2.6/"},"formats":{"html":"/en/dev/releases/5.2.7/","markdown":"/en/dev/releases/5.2.7.md","json":"/en/dev/releases/5.2.7.json"},"source":"https://github.com/django/django/blob/main/docs/releases/5.2.7.txt","official":"https://docs.djangoproject.com/en/dev/releases/5.2.7/","inVersions":["dev","6.1","6.0","5.2"],"inLocales":["en"]}