CVE-2026-124827: Server-side file-write via RasterField assignment
An issue was discovered in Django 6.1 before 6.1.4, 6.0 before 6.0.11, and 5.2 before 5.2.20. django.contrib.gis.db.models.RasterField allows the creation of files at attacker-controlled locations via the name parameter of a data definition. Depending on the raster driver, this could enable 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 Mohammed Fathy for reporting this issue.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.1.4 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.0.11 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.2.20
Event History
Frequently Asked Questions
Which Django versions should be remediated?
Upgrade Django 6.1 to 6.1.4 or later, 6.0 to 6.0.11 or later, or 5.2 to 5.2.20 or later. Unsupported series including 5.1.x, 5.0.x, and 4.2.x were not evaluated and may also be affected.
What must an attacker be able to control to exploit this issue?
An attacker needs the ability to influence the name parameter of a RasterField data definition. That control can allow creation of files at attacker-chosen locations; the impact may include remote code execution depending on the raster driver.
Are applications that do not use RasterField affected?
The reported vulnerable functionality is django.contrib.gis.db.models.RasterField. The provided information does not identify exposure outside uses of this field.