{"title":"Django 4.2.17 release notes","version":"dev","locale":"en","docname":"releases/4.2.17","url":"/en/dev/releases/4.2.17/","canonical":"https://djangodocs.dev/en/dev/releases/4.2.17/","summary":"Django 4.2.17 fixes one security issue with severity “high” and one security issue with severity “moderate” in 4.2.16.","html":"<h1>Django 4.2.17 release notes<a class=\"heading-anchor\" href=\"#django-4-2-17-release-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><em>December 4, 2024</em></p>\n<p>Django 4.2.17 fixes one security issue with severity “high” and one security\nissue with severity “moderate” in 4.2.16.</p>\n<section id=\"cve-2024-53907-denial-of-service-possibility-in-strip-tags\">\n<h2>CVE-2024-53907: Denial-of-service possibility in <code class=\"docutils literal notranslate\">strip_tags()</code><a class=\"heading-anchor\" href=\"#cve-2024-53907-denial-of-service-possibility-in-strip-tags\"><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.html.strip_tags\" title=\"django.utils.html.strip_tags\"><code class=\"xref py py-func docutils literal notranslate\">strip_tags()</code></a> would be extremely slow to evaluate\ncertain inputs containing large sequences of nested incomplete HTML entities.\nThe <code class=\"docutils literal notranslate\">strip_tags()</code> method is used to implement the corresponding\n<a class=\"reference internal\" href=\"/en/dev/ref/templates/builtins/#std-templatefilter-striptags\"><code class=\"xref std std-tfilter docutils literal notranslate\">striptags</code></a> template filter, which was thus also vulnerable.</p>\n<p><code class=\"docutils literal notranslate\">strip_tags()</code> now has an upper limit of recursive calls to <code class=\"docutils literal notranslate\">HTMLParser</code>\nbefore raising a <a class=\"reference internal\" href=\"/en/dev/ref/exceptions/#django.core.exceptions.SuspiciousOperation\" title=\"django.core.exceptions.SuspiciousOperation\"><code class=\"xref py py-exc docutils literal notranslate\">SuspiciousOperation</code></a> exception.</p>\n<p>Remember that absolutely NO guarantee is provided about the results of\n<code class=\"docutils literal notranslate\">strip_tags()</code> being HTML safe. So NEVER mark safe the result of a\n<code class=\"docutils literal notranslate\">strip_tags()</code> call without escaping it first, for example with\n<a class=\"reference internal\" href=\"/en/dev/ref/utils/#django.utils.html.escape\" title=\"django.utils.html.escape\"><code class=\"xref py py-func docutils literal notranslate\">django.utils.html.escape()</code></a>.</p>\n</section>\n<section id=\"cve-2024-53908-potential-sql-injection-via-haskey-lhs-rhs-on-oracle\">\n<h2>CVE-2024-53908: Potential SQL injection via <code class=\"docutils literal notranslate\">HasKey(lhs, rhs)</code> on Oracle<a class=\"heading-anchor\" href=\"#cve-2024-53908-potential-sql-injection-via-haskey-lhs-rhs-on-oracle\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Direct usage of the <code class=\"docutils literal notranslate\">django.db.models.fields.json.HasKey</code> lookup on Oracle\nwas subject to SQL injection if untrusted data was used as a <code class=\"docutils literal notranslate\">lhs</code> value.</p>\n<p>Applications that use the <a class=\"reference internal\" href=\"/en/dev/topics/db/queries/#std-fieldlookup-jsonfield.has_key\"><code class=\"xref std std-lookup docutils literal notranslate\">has_key</code></a> lookup through\nthe <code class=\"docutils literal notranslate\">__</code> syntax are unaffected.</p>\n</section>","rootId":"django-4-2-17-release-notes","toc":[{"title":"CVE-2024-53907: Denial-of-service possibility in strip_tags()","anchor":"cve-2024-53907-denial-of-service-possibility-in-strip-tags","children":[]},{"title":"CVE-2024-53908: Potential SQL injection via HasKey(lhs, rhs) on Oracle","anchor":"cve-2024-53908-potential-sql-injection-via-haskey-lhs-rhs-on-oracle","children":[]}],"breadcrumbs":[{"docname":"releases/index","title":"Release notes","url":"/en/dev/releases/"}],"prev":{"docname":"releases/4.2.18","title":"Django 4.2.18 release notes","url":"/en/dev/releases/4.2.18/"},"next":{"docname":"releases/4.2.16","title":"Django 4.2.16 release notes","url":"/en/dev/releases/4.2.16/"},"formats":{"html":"/en/dev/releases/4.2.17/","markdown":"/en/dev/releases/4.2.17.md","json":"/en/dev/releases/4.2.17.json"},"source":"https://github.com/django/django/blob/main/docs/releases/4.2.17.txt","official":"https://docs.djangoproject.com/en/dev/releases/4.2.17/","inVersions":["dev","6.1","6.0","5.2","5.1","5.0","4.2"],"inLocales":["en"]}