Django patches RasterField file-write RCE (CVE-2026-124827)
Django 6.1.4, 6.0.11 and 5.2.20 fix CVE-2026-124827, a GeoDjango RasterField server-side file write that can escalate to code execution. No in-the-wild exploitation reported.
Django shipped security releases 6.1.4, 6.0.11 and 5.2.20 on December 2, closing seven vulnerabilities. The one to act on is CVE-2026-124827: a GeoDjango RasterField can be coerced into writing an attacker-controlled file to an attacker-controlled path, which — depending on the GDAL driver in play — escalates to remote code execution.
The primary source is the Django security release post. The Django Security Team rates CVE-2026-124827 High, not critical (more on that below).
What's affected
- Branches: Django main, 6.1, 6.0 and 5.2.
- The bug is in
RasterField, which is only implemented on PostGIS. Plain geometry fields are not affected. - Because
RasterFieldfalls back to theCharFieldform field, it was reachable by default anywhere the field is exposed — the admin, aModelForm, or a writable model serializer.
Per Django's note, assigning a raster data definition to RasterField with a user-controlled name and a non-default driver "could cause GDAL to write a file to an attacker-controlled location." Whether that reaches code execution depends on which driver the attacker can select.
Exploitation status
No in-the-wild exploitation has been reported, and the CVE is not in CISA's KEV catalog as of this writing. Mohamed K. Fathy of Robusta Technology Group, who reported the issue and gave it the "Django4shell" codename, describes the main precondition as staff-level authentication, plus a model exposing RasterField and a GDAL build with a usable file-writing driver (he cites EHdr).
Action checklist
- Upgrade to 6.1.4, 6.0.11 or 5.2.20 — pick the release on your branch. The fixed packages are on PyPI and listed in the release post.
- If you can't upgrade immediately, audit every model with a
RasterFieldand remove it from admin forms,ModelForms and writable serializers. After upgrade,editabledefaults toFalse, so the field is excluded from forms unless you opt in. - Note the post's caveat: the fix limits file writes, but server-side request forgery is still possible if untrusted input reaches
RasterField. Validate input regardless. - While you're patching, triage the other fixes in the same release, notably CVE-2026-132092 (High) — SQL injection in
rangeandinlookups — and CVE-2026-115868 (Moderate), an XSS in thetruncatechars_htmlfilter.
What other outlets missed
Early coverage pinned CVE-2026-124827 as a "critical" RCE scored 9.0 and framed it as an incomplete fix of two earlier GeoDjango bugs. Django's own advisory says neither: it rates the flaw High, and the December 2 release post does not describe it as an incomplete fix of a prior CVE — it is listed as a standalone server-side file write. The "Django4shell" branding and the critical framing come from the reporting researcher, not the Django Security Team. If you're triaging by vendor severity, treat it as High and reachable-by-default — which is reason enough to patch promptly.