CVE-2026-124827: Django4Shell in GeoDjango RasterField
How user-controlled raster input can turn a map field into a server-side file write and possible remote code execution path

CVE-2026-124827 is a newly published Django vulnerability in GeoDjango's RasterField, posted on December 2, 2026. Django rates it as high severity, and NVD scores it 8.7. The flaw affects supported upstream releases in the 5.2, 6.0, and 6.1 lines, but it also matters to teams still running older unsupported branches because the issue sits in Django code that handles raster input. If your application accepts untrusted data into RasterField, especially through the admin, ModelForms, or writable serializers, this is worth urgent review.
Affected and unsupported? See NES for Django.
What is CVE-2026-124827?
CVE-2026-124827 is a server-side file-write vulnerability in django.contrib.gis.db.models.RasterField. According to Django's December 2, 2026 security release, assigning a raster data definition with a user-controlled name parameter and a non-default driver could make GDAL write a file to a location the attacker controls.
That matters because a file write is often more than a data integrity issue. Django says some raster drivers could turn this into remote code execution. In practice, the exposure is tied to applications that accept untrusted raster input and pass it into RasterField without strict validation.
The advisory also makes clear why this bug may be reachable in real applications. RasterField fell back to Django's CharField form field behavior, which meant it was reachable by default on models with RasterField exposed through the admin, through ModelForms, or through writable model serializers.
Two scope limits are important. First, geometry fields are not affected. Second, Django says RasterField is only implemented on PostGIS.
How severe is CVE-2026-124827?
Django classifies this issue as high severity in its own security policy, and NVD scores it 8.7. The practical risk comes from the possibility of attacker-controlled file creation on the server, which Django says may lead to remote code execution depending on the raster driver in use.
This is not a broad "all Django apps are exposed" situation. The affected feature is GeoDjango RasterField, and the attack path depends on an application accepting untrusted raster definitions. Still, for teams that do use raster input, the impact is serious enough to treat this as an immediate patching and review priority.
Which Django versions are affected?
| Version | Affected? | Free fix available? | Covered by HeroDevs? |
|---|---|---|---|
| Django 6.1 before 6.1.4 | Yes | Yes, upgrade to 6.1.4 | No |
| Django 6.0 before 6.0.11 | Yes | Yes, upgrade to 6.0.11 | No |
| Django 5.2 before 5.2.20 | Yes | Yes, upgrade to 5.2.20 | No |
| Django 4.2 | Not listed in the upstream advisory | No free fix listed | Yes |
| Django 3.2 | Not listed in the upstream advisory | No free fix listed | Yes |
HeroDevs covers Django 3.2 and 4.2 through Never-Ending Support, while upstream fixes announced so far are for Django 5.2, 6.0, and 6.1. That makes this a high-interest issue for organizations that still depend on older Django lines in production and need a supported path short of a major migration.
How to fix or reduce the risk
| If you are on | Do this |
|---|---|
| Django 6.1 | Upgrade to 6.1.4. |
| Django 6.0 | Upgrade to 6.0.11. |
| Django 5.2 | Upgrade to 5.2.20. |
| Django 4.2 | Review whether your application uses GeoDjango RasterField, and see NES for Django for support on unsupported lines. |
| Django 3.2 | Review whether your application uses GeoDjango RasterField, and see NES for Django for support on unsupported lines. |
Django's fix does two important things. RasterField now defaults editable to False, which keeps it out of a ModelForm unless a developer explicitly includes it. Django also now raises GDALException when code assigns a dict or JSON string that specifies a non-default driver.
If you cannot patch immediately, start by identifying every place untrusted input can reach RasterField, especially in the admin, forms, and serializers. Django notes that wrapping the definition in GDALRaster is now the way to mark a value as trusted when using other drivers.
One more caution from the Django advisory: the new exception limits server-side file writes, but server-side request forgery is still possible if untrusted input is assigned to RasterField. That means input validation and architectural review still matter even after patching.
Taking action
Teams using GeoDjango with RasterField should review this issue now, even if only a small part of the application handles raster data. If you are on a supported upstream line, move to the fixed release. If you are still running an older Django branch in production, HeroDevs NES for Django gives you a supported way to stay protected while you plan the longer migration work.
For a shorter reference on the affected versions and current support path, see the HeroDevs vulnerability directory entry for CVE-2026-124827.
Resources
View All Articles


