{"title":"Django 4.2.25 release notes","version":"dev","locale":"en","docname":"releases/4.2.25","url":"/en/dev/releases/4.2.25/","canonical":"https://djangodocs.dev/en/dev/releases/4.2.25/","summary":"Django 4.2.25 fixes one security issue with severity “high” and one security issue with severity “low” in 4.2.24.","html":"<h1>Django 4.2.25 release notes<a class=\"heading-anchor\" href=\"#django-4-2-25-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 4.2.25 fixes one security issue with severity “high” and one security\nissue with severity “low” in 4.2.24.</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>","rootId":"django-4-2-25-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":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/4.2.26","title":"Django 4.2.26 release notes","url":"/en/dev/releases/4.2.26/"},"next":{"docname":"releases/4.2.24","title":"Django 4.2.24 release notes","url":"/en/dev/releases/4.2.24/"},"formats":{"html":"/en/dev/releases/4.2.25/","markdown":"/en/dev/releases/4.2.25.md","json":"/en/dev/releases/4.2.25.json"},"source":"https://github.com/django/django/blob/main/docs/releases/4.2.25.txt","official":"https://docs.djangoproject.com/en/dev/releases/4.2.25/","inVersions":["dev","6.1","6.0","5.2","5.1","4.2"],"inLocales":["en"]}