Django Patches GeoDjango RasterField File-Write Flaw

· CyberSecurity

TLDR

  • Django 6.1.4, 6.0.11 and 5.2.20 fix CVE-2026-124827, a RasterField file-write flaw that could enable remote code execution.1
  • Django rates it "high"; The Hacker News reports CVSS 9.0, while the CVE record lists 8.8 under CVSS 3.1.123
  • Six other fixes ship alongside, including a "high" SQL injection in range and in lookups, CVE-2026-132092.1

The Django project issued security releases for Django 6.1.4, 6.0.11 and 5.2.20 on 2 December 2026, fixing seven vulnerabilities and urging all users to upgrade as soon as possible.1 The most serious, CVE-2026-124827, concerns GeoDjango's RasterField.1 Django says that assigning a raster data definition with a user-controlled name parameter and a non-default driver could cause GDAL to write a file to an attacker-controlled location, and that depending on the raster driver this could enable remote code execution.1 Because RasterField falls back to the CharField form field, Django says the flaw was reachable by default on models with RasterField registered in the admin or used in ModelForms or writable model serializers.1 The project rates the issue "high" and credits Mohammed Fathy with the report.1

The Hacker News, which says the flaw has been codenamed Django4shell by Mohamed K. Fathy of Robusta Technology Group, reports a CVSS score of 9.0.2 The CVE record, published by the Django Software Foundation, lists a CVSS 3.1 base score of 8.8 and a CVSS 4.0 base score of 8.7, both rated high.3 The Hacker News describes CVE-2026-124827 as an incomplete fix for CVE-2026-87890, which is itself an incomplete patch for CVE-2026-15307, addressed in August 2026.2 Fathy told the outlet that an attacker controls the target path, file content and filename through a crafted JSON raster body, which could be used to overwrite application source code, drop web shells into static directories or write a sitecustomize.py file that Python imports at start-up.2 The outlet quotes him as saying the primary requirement is staff-level authentication, and lists four preconditions, three of which he says a default GeoDjango deployment meets.2 The exploitation details and the 9.0 score rest on The Hacker News and Fathy alone; Django itself gives only a "high" severity rating.12

Django's fix makes RasterField default editable to False, which excludes it from a ModelForm unless explicitly included.1 RasterField also now raises GDALException when a dict or JSON string specifies a non-default driver, and code that needs other drivers must wrap the definition in GDALRaster to mark the value as trusted.1 Django says this only limits server-side file writes, that server-side request forgery is still possible if untrusted input is assigned to RasterField, and that geometry fields were not affected.1 It also says RasterField is only implemented on PostGIS.1

Six further issues were fixed in the same releases.1 CVE-2026-132092 is a potential SQL injection in range and in lookups, in queries involving aliases or key transforms containing percent signs, which Django also rates "high".1 CVE-2026-115868 is a potential cross-site scripting flaw in the truncatechars_html filter, rated "moderate".1 CVE-2026-125673 is a cache poisoning issue through dot segments in request paths, rated "low", and Django says users should clear any potentially affected caches after upgrading, because existing cached responses are not invalidated.1 Three further "low" issues cover two admin changelist information leaks, CVE-2026-119642 and CVE-2026-127929, and a heap buffer overflow in OGRGeometry.wkb, CVE-2026-132809.1

Why it matters: teams running GeoDjango with RasterField exposed through the admin or model forms are open to a file-write route that Django says can lead to remote code execution, and The Hacker News reports it needs only a staff login, until they move to Django 6.1.4, 6.0.11 or 5.2.20.12

Sources

  1. Django security releases issued: 6.1.4, 6.0.11, and 5.2.20 (Django Weblog (Django Software Foundation))
  2. New Django4Shell Vulnerability Enables Django RCE via GeoDjango Form Validation (The Hacker News)
  3. CVE Record: CVE-2026-124827 (CVE Program)