An issue was discovered in Django 5.2 before 5.2.17 and 6.0 before 6.0.8.
GeoDjango spatial lookups optimistically parse the right-hand-side value as a raster by passing it to the django.contrib.gis.gdal.GDALRaster constructor. Any value used in a spatial lookup against a GeometryField or RasterField reaches this constructor, including untrusted input, for example a spatial-field filter submitted through the Django admin changelist query string by a staff user with view permission. A dict, or a str holding its JSON representation, is opened in write mode regardless of the constructors write=False default, allowing a file with an attacker-chosen name and contents to be written through a file-backed GDAL driver. Any other str is treated as a datasource, allowing an outbound network request through a GDAL virtual filesystem handler. Writing a file to a location later imported by the application can result in remote code execution.
Earlier, unsupported Django series (such as 5.1.x, 5.0.x, and 4.2.x) were not evaluated and may also be affected.
Django would like to thank Bence Nagy, localhost-detect, and kimchunbok_ for reporting this issue.
The product allows user input to control or influence paths or file names that are used in filesystem operations.
| Name | Vendor | Start Version | End Version |
|---|---|---|---|
| Django | Djangoproject | * | 5.2.17 (excluding) |
| Django | Djangoproject | 6.0 (including) | 6.0.8 (excluding) |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | RedHat | python3.12-django-0:5.2.17-1.el8ap | * |
| Red Hat Ansible Automation Platform 2.5 for RHEL 8 | RedHat | python3.12-django-0:5.2.17-1.el8ap | * |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | RedHat | python3.12-django-0:5.2.17-1.el9ap | * |
| Red Hat Ansible Automation Platform 2.5 for RHEL 9 | RedHat | python3.12-django-0:5.2.17-1.el9ap | * |
| Red Hat Ansible Automation Platform 2.6 for RHEL 10 | RedHat | python-django-0:5.2.17-1.el10ap | * |
| Red Hat Ansible Automation Platform 2.6 for RHEL 10 | RedHat | python-django-0:5.2.17-1.el10ap | * |
| Red Hat Ansible Automation Platform 2.6 for RHEL 9 | RedHat | python3.12-django-0:5.2.17-1.el9ap | * |
| Red Hat Ansible Automation Platform 2.6 for RHEL 9 | RedHat | python3.12-django-0:5.2.17-1.el9ap | * |
| Red Hat Ansible Automation Platform 2.7 for RHEL 10 | RedHat | python-django-0:5.2.17-1.el10ap | * |
| Red Hat Ansible Automation Platform 2.7 for RHEL 10 | RedHat | python-django-0:5.2.17-1.el10ap | * |
| Red Hat Ansible Automation Platform 2.7 for RHEL 9 | RedHat | python3.12-django-0:5.2.17-1.el9ap | * |
| Red Hat Ansible Automation Platform 2.7 for RHEL 9 | RedHat | python3.12-django-0:5.2.17-1.el9ap | * |
| Red Hat Satellite 6.16 for RHEL 8 | RedHat | python-django-0:4.2.30-2.el8pc | * |
| Red Hat Satellite 6.16 for RHEL 8 | RedHat | python-pyyaml-0:6.0.1-1.el8pc | * |
| Red Hat Satellite 6.16 for RHEL 8 | RedHat | python-django-0:4.2.30-2.el8pc | * |
| Red Hat Satellite 6.16 for RHEL 8 | RedHat | python-pyyaml-0:6.0.1-1.el8pc | * |
| Red Hat Satellite 6.16 for RHEL 9 | RedHat | python-django-0:4.2.30-2.el9pc | * |
| Red Hat Satellite 6.16 for RHEL 9 | RedHat | python-pyyaml-0:6.0.1-1.el9pc | * |
| Red Hat Satellite 6.16 for RHEL 9 | RedHat | python-django-0:4.2.30-2.el9pc | * |
| Red Hat Satellite 6.16 for RHEL 9 | RedHat | python-pyyaml-0:6.0.1-1.el9pc | * |
| Red Hat Satellite 6.17 for RHEL 9 | RedHat | python-django-0:4.2.30-2.el9pc | * |
| Red Hat Satellite 6.17 for RHEL 9 | RedHat | python-django-0:4.2.30-2.el9pc | * |
| Red Hat Satellite 6.18 for RHEL 9 | RedHat | python3.12-django-0:4.2.30-3.el9pc | * |
| Red Hat Satellite 6.18 for RHEL 9 | RedHat | python3.12-django-0:4.2.30-3.el9pc | * |
| Red Hat Satellite 6.19 for RHEL 9 | RedHat | python3.12-django-0:4.2.30-3.el9pc | * |
| Red Hat Satellite 6.19 for RHEL 9 | RedHat | python3.12-django-0:4.2.30-3.el9pc | * |
| Red Hat Ansible Automation Platform 2.2 | RedHat | ansible-automation-platform/bootc-automation-portal-rhel9:1788943531 | * |
| Red Hat Ansible Automation Platform 2.5 | RedHat | ansible-automation-platform-25/hub-rhel8:1787101922 | * |
| Red Hat Ansible Automation Platform 2.5 | RedHat | ansible-automation-platform-25/lightspeed-rhel8:1787229385 | * |
| Red Hat Ansible Automation Platform 2.5 | RedHat | ansible-automation-platform-25/controller-rhel8:1789607021 | * |
| Red Hat Ansible Automation Platform 2.6 | RedHat | ansible-automation-platform-26/hub-rhel9:1787220598 | * |
| Red Hat Ansible Automation Platform 2.6 | RedHat | ansible-automation-platform-26/lightspeed-rhel9:1787244079 | * |
| Red Hat Ansible Automation Platform 2.6 | RedHat | ansible-automation-platform-26/controller-rhel9:1789673739 | * |
| Red Hat Ansible Automation Platform 2.6 | RedHat | ansible-automation-platform-tech-preview/metrics-service-rhel9:1789654558 | * |
| Red Hat Ansible Automation Platform 2.7 | RedHat | ansible-automation-platform-27/lightspeed-rhel9:1787217531 | * |
| Red Hat Ansible Automation Platform 2.7 | RedHat | ansible-automation-platform-27/controller-rhel9:1788918363 | * |
| Red Hat Ansible Automation Platform 2.7 | RedHat | ansible-automation-platform-27/hub-rhel9:1788918708 | * |
| Red Hat Ansible Automation Platform 2.7 | RedHat | ansible-automation-platform-27/metrics-service-rhel9:1788917058 | * |
| Python-django | Ubuntu | esm-infra/bionic | * |
| Python-django | Ubuntu | esm-infra/focal | * |
| Python-django | Ubuntu | jammy | * |
| Python-django | Ubuntu | noble | * |
| Python-django | Ubuntu | resolute | * |
| Python-django | Ubuntu | upstream | * |
This could allow an attacker to access or modify system files or other files that are critical to the application. Path manipulation errors occur when the following two conditions are met:
For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.