| 1 |
========================== |
| 2 |
Django 5.2.2 release notes |
| 3 |
========================== |
| 4 |
|
| 5 |
*June 4, 2025* |
| 6 |
|
| 7 |
Django 5.2.2 fixes a security issue with severity "low" and several bugs in |
| 8 |
5.2.1. |
| 9 |
|
| 10 |
CVE-2025-48432: Potential log injection via unescaped request path |
| 11 |
================================================================== |
| 12 |
|
| 13 |
Internal HTTP response logging used ``request.path`` directly, allowing control |
| 14 |
characters (e.g. newlines or ANSI escape sequences) to be written unescaped |
| 15 |
into logs. This could enable log injection or forgery, letting attackers |
| 16 |
manipulate log appearance or structure, especially in logs processed by |
| 17 |
external systems or viewed in terminals. |
| 18 |
|
| 19 |
Although this does not directly impact Django's security model, it poses risks |
| 20 |
when logs are consumed or interpreted by other tools. To fix this, the internal |
| 21 |
``django.utils.log.log_response()`` function now escapes all positional |
| 22 |
formatting arguments using a safe encoding. |
| 23 |
|
| 24 |
Bugfixes |
| 25 |
======== |
| 26 |
|
| 27 |
* Fixed a crash when using ``select_related`` against a ``ForeignObject`` |
| 28 |
originating from a model with a ``CompositePrimaryKey`` (:ticket:`36373`). |
| 29 |
|
| 30 |
* Fixed a bug in Django 5.2 where subqueries using ``"pk"`` to reference models |
| 31 |
with a ``CompositePrimaryKey`` failed to raise ``ValueError`` when too many |
| 32 |
or too few columns were selected (:ticket:`36392`). |
| 33 |
|
| 34 |
* Fixed a regression in Django 5.2 that caused a crash when no arguments were |
| 35 |
passed into ``QuerySet.union()`` (:ticket:`36388`). |
| 36 |
|
| 37 |
* Fixed a regression in Django 5.2 where subclasses of ``RemoteUserMiddleware`` |
| 38 |
that had overridden ``process_request()`` were no longer supported |
| 39 |
(:ticket:`36390`). |
| 40 |
|
| 41 |
* Fixed a regression in Django 5.2 that caused a crash when using ``OuterRef`` |
| 42 |
in the ``filter`` argument of an ``Aggregate`` expression (:ticket:`36404`). |
| 43 |
|
| 44 |
* Fixed a regression in Django 5.2 that caused a crash when using ``OuterRef`` |
| 45 |
in PostgreSQL aggregate functions ``ArrayAgg``, ``StringAgg``, and |
| 46 |
``JSONBAgg`` (:ticket:`36405`). |
| 47 |
|
| 48 |
* Fixed a regression in Django 5.2 where admin's ``filter_horizontal`` buttons |
| 49 |
lacked ``type="button"``, causing them to intercept form submission when |
| 50 |
pressing the Enter key (:ticket:`36423`). |
| 51 |
|
| 52 |
* Fixed a bug in Django 5.2 where calling ``QuerySet.in_bulk()`` with an |
| 53 |
``id_list`` argument on models with a ``CompositePrimaryKey`` failed to |
| 54 |
observe database parameter limits (:ticket:`36416`). |
| 55 |
|
| 56 |
* Fixed a bug in Django 5.2 where :meth:`HttpRequest.get_preferred_type() |
| 57 |
<django.http.HttpRequest.get_preferred_type>` did not account for media type |
| 58 |
parameters in ``Accept`` headers, reducing specificity in content negotiation |
| 59 |
(:ticket:`36411`). |
| 60 |
|
| 61 |
* Fixed a regression in Django 5.2 that caused a crash when using |
| 62 |
``QuerySet.prefetch_related()`` to prefetch a foreign key with a ``Prefetch`` |
| 63 |
queryset for a subclass of the foreign target (:ticket:`36432`). |