{"title":"Django 5.2.17 release notes","version":"dev","locale":"en","docname":"releases/5.2.17","url":"/en/dev/releases/5.2.17/","canonical":"https://djangodocs.dev/en/dev/releases/5.2.17/","summary":"Django 5.2.17 fixes one security issue with severity “high”, two security issues with severity “moderate”, and one security issue with severity “low” in…","html":"<h1>Django 5.2.17 release notes<a class=\"heading-anchor\" href=\"#django-5-2-17-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>August 4, 2026</em></p>\n<p>Django 5.2.17 fixes one security issue with severity “high”, two security\nissues with severity “moderate”, and one security issue with severity “low” in\n5.2.16.</p>\n<section id=\"cve-2026-15307-server-side-file-write-and-request-forgery-via-spatial-lookups\">\n<h2>CVE-2026-15307: Server-side file-write and request forgery via spatial lookups<a class=\"heading-anchor\" href=\"#cve-2026-15307-server-side-file-write-and-request-forgery-via-spatial-lookups\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Spatial lookups allowed <code class=\"docutils literal notranslate\">str</code> and <code class=\"docutils literal notranslate\">dict</code> lookup values to be passed to\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/gdal/#django.contrib.gis.gdal.GDALRaster\" title=\"django.contrib.gis.gdal.GDALRaster\"><code class=\"xref py py-class docutils literal notranslate\">GDALRaster</code></a> when they represented rasters.\nDepending on the raster driver, this could write a file to disk (in some cases\nenabling remote code execution) or issue a network request as the Django\nprocess user. Because the admin changelist permits filtering via\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.lookup_allowed\" title=\"django.contrib.admin.ModelAdmin.lookup_allowed\"><code class=\"xref py py-meth docutils literal notranslate\">lookup_allowed()</code></a>, the flaw was reachable\nby staff users with view permission on any registered model containing a\nspatial field.</p>\n<p>The following types are now disallowed by spatial lookups:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">dict</code></p></li>\n<li><p>A <code class=\"docutils literal notranslate\">str</code> that is not a valid\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry\" title=\"django.contrib.gis.geos.GEOSGeometry\"><code class=\"xref py py-class docutils literal notranslate\">GEOSGeometry</code></a>, e.g. a serialized dictionary</p></li>\n</ul>\n<p>This is a backward incompatible change. As a reminder, all untrusted user input\nshould be validated before use. For that reason, assignments to model fields\nare unaffected and still accept these input types.</p>\n<p>For guidance on how to keep using these types in spatial lookups, on validating\nuntrusted input, and on further security considerations, see\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/gdal/#raster-security\"><span class=\"std std-ref\">raster security considerations</span></a>.</p>\n<p>This issue has severity “high” 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=\"cve-2026-15337-potential-denial-of-service-vulnerability-in-check-for-language\">\n<h2>CVE-2026-15337: Potential denial-of-service vulnerability in <code class=\"docutils literal notranslate\">check_for_language()</code><a class=\"heading-anchor\" href=\"#cve-2026-15337-potential-denial-of-service-vulnerability-in-check-for-language\"><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.check_for_language\" title=\"django.utils.translation.check_for_language\"><code class=\"xref py py-func docutils literal notranslate\">check_for_language()</code></a> was subject to a potential\ndenial-of-service attack when checking many distinct, very long language codes.\nEach code was used as a key in an in-memory cache, consuming process memory.</p>\n<p>The <code class=\"docutils literal notranslate\">language</code> value reaches this function through the\n<a class=\"reference internal\" href=\"/en/dev/topics/i18n/translation/#django.views.i18n.set_language\" title=\"django.views.i18n.set_language\"><code class=\"xref py py-func docutils literal notranslate\">django.views.i18n.set_language()</code></a> view (not active by default) from POST\ndata. Since request data is limited by <a class=\"reference internal\" href=\"/en/dev/ref/settings/#std-setting-DATA_UPLOAD_MAX_MEMORY_SIZE\"><code class=\"xref std std-setting docutils literal notranslate\">DATA_UPLOAD_MAX_MEMORY_SIZE</code></a>\nand the cache is configured to store a maximum number of entries, the memory\nthat could be consumed was bounded.</p>\n<p>To mitigate this vulnerability, language codes longer than 500 characters are\nnow rejected before the cached lookup.</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=\"cve-2026-15830-potential-denial-of-service-vulnerability-via-nested-geometry-collections\">\n<h2>CVE-2026-15830: Potential denial-of-service vulnerability via nested geometry collections<a class=\"heading-anchor\" href=\"#cve-2026-15830-potential-denial-of-service-vulnerability-via-nested-geometry-collections\"><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/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry\" title=\"django.contrib.gis.geos.GEOSGeometry\"><code class=\"xref py py-class docutils literal notranslate\">GEOSGeometry</code></a> was subject to a potential\ndenial-of-service attack when provided deeply nested <code class=\"docutils literal notranslate\">GEOMETRYCOLLECTION</code>\nobjects, leading to a segmentation fault in GEOS. A maximum depth of 198\n<code class=\"docutils literal notranslate\">GEOMETRYCOLLECTION</code>s is now enforced for the well-known text (WKT) format,\nand a maximum number of 198 <code class=\"docutils literal notranslate\">GEOMETRYCOLLECTION</code>s in total (breadth and\ndepth) is enforced for well-known binary (WKB).</p>\n<p><a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/db-api/#spatial-lookups-intro\"><span class=\"std std-ref\">Lookups against spatial fields</span></a> and the\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/forms-api/#django.contrib.gis.forms.GeometryField\" title=\"django.contrib.gis.forms.GeometryField\"><code class=\"xref py py-class docutils literal notranslate\">GeometryField</code></a> form field were also affected.</p>\n<p>The limit can be customized through the new <code class=\"docutils literal notranslate\">max_geom_collections</code> argument,\navailable on <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry\" title=\"django.contrib.gis.geos.GEOSGeometry\"><code class=\"xref py py-class docutils literal notranslate\">GEOSGeometry</code></a>, the\n<a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/forms-api/#django.contrib.gis.forms.Field.max_geom_collections\" title=\"django.contrib.gis.forms.Field.max_geom_collections\"><code class=\"xref py py-attr docutils literal notranslate\">form field</code></a>,\nand the <a class=\"reference internal\" href=\"/en/dev/ref/contrib/gis/model-api/#django.contrib.gis.db.models.GeometryField.max_geom_collections\" title=\"django.contrib.gis.db.models.GeometryField.max_geom_collections\"><code class=\"xref py py-attr docutils literal notranslate\">model field</code></a>. The limit\nis not applied to GeoJSON inputs, as they were parsed by GDAL and are not\naffected.</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-15920-potential-cross-site-scripting-via-urlfield-values-in-the-admin\">\n<h2>CVE-2026-15920: Potential cross-site scripting via <code class=\"docutils literal notranslate\">URLField</code> values in the admin<a class=\"heading-anchor\" href=\"#cve-2026-15920-potential-cross-site-scripting-via-urlfield-values-in-the-admin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The admin renders <a class=\"reference internal\" href=\"/en/dev/ref/models/fields/#django.db.models.URLField\" title=\"django.db.models.URLField\"><code class=\"xref py py-class docutils literal notranslate\">URLField</code></a> values as clickable links\non changelist views and read-only fields. The link was generated without\nvalidating the value as a safe URL, so a stored value using a potentially\ndangerous scheme was rendered as a link.</p>\n<p><code class=\"docutils literal notranslate\">URLField</code> values shown via <code class=\"docutils literal notranslate\">display_for_field</code> are now validated using\n<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> before a link is rendered, and\ndisplayed as plain text if validation is failed.</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>","rootId":"django-5-2-17-release-notes","toc":[{"title":"CVE-2026-15307: Server-side file-write and request forgery via spatial lookups","anchor":"cve-2026-15307-server-side-file-write-and-request-forgery-via-spatial-lookups","children":[]},{"title":"CVE-2026-15337: Potential denial-of-service vulnerability in check_for_language()","anchor":"cve-2026-15337-potential-denial-of-service-vulnerability-in-check-for-language","children":[]},{"title":"CVE-2026-15830: Potential denial-of-service vulnerability via nested geometry collections","anchor":"cve-2026-15830-potential-denial-of-service-vulnerability-via-nested-geometry-collections","children":[]},{"title":"CVE-2026-15920: Potential cross-site scripting via URLField values in the admin","anchor":"cve-2026-15920-potential-cross-site-scripting-via-urlfield-values-in-the-admin","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/5.2.18","title":"Django 5.2.18 release notes","url":"/en/dev/releases/5.2.18/"},"next":{"docname":"releases/5.2.16","title":"Django 5.2.16 release notes","url":"/en/dev/releases/5.2.16/"},"formats":{"html":"/en/dev/releases/5.2.17/","markdown":"/en/dev/releases/5.2.17.md","json":"/en/dev/releases/5.2.17.json"},"source":"https://github.com/django/django/blob/main/docs/releases/5.2.17.txt","official":"https://docs.djangoproject.com/en/dev/releases/5.2.17/","inVersions":["dev","6.1","6.0","5.2"],"inLocales":["en"]}