Debian Codegraph @

docs/releases/5.1.4.txt

raw
1 ==========================
2 Django 5.1.4 release notes
3 ==========================
4
5 *December 4, 2024*
6
7 Django 5.1.4 fixes one security issue with severity "high", one security issue
8 with severity "moderate", and several bugs in 5.1.3.
9
10 CVE-2024-53907: Denial-of-service possibility in ``strip_tags()``
11 =================================================================
12
13 :func:`~django.utils.html.strip_tags` would be extremely slow to evaluate
14 certain inputs containing large sequences of nested incomplete HTML entities.
15 The ``strip_tags()`` method is used to implement the corresponding
16 :tfilter:`striptags` template filter, which was thus also vulnerable.
17
18 ``strip_tags()`` now has an upper limit of recursive calls to ``HTMLParser``
19 before raising a :exc:`.SuspiciousOperation` exception.
20
21 Remember that absolutely NO guarantee is provided about the results of
22 ``strip_tags()`` being HTML safe. So NEVER mark safe the result of a
23 ``strip_tags()`` call without escaping it first, for example with
24 :func:`django.utils.html.escape`.
25
26 CVE-2024-53908: Potential SQL injection via ``HasKey(lhs, rhs)`` on Oracle
27 ==========================================================================
28
29 Direct usage of the ``django.db.models.fields.json.HasKey`` lookup on Oracle
30 was subject to SQL injection if untrusted data was used as a ``lhs`` value.
31
32 Applications that use the :lookup:`has_key <jsonfield.has_key>` lookup through
33 the ``__`` syntax are unaffected.
34
35 Bugfixes
36 ========
37
38 * Fixed a crash in ``createsuperuser`` on Python 3.13+ caused by an unhandled
39 ``OSError`` when the username could not be determined (:ticket:`35942`).
40
41 * Fixed a regression in Django 5.1 where relational fields were not updated
42 when calling ``Model.refresh_from_db()`` on instances with deferred fields
43 (:ticket:`35950`).