Security

Django releases 6.1.4, 6.0.11, 5.2.20 to fix seven security issues

The patch fixes high-severity CVE-2026-124827, a server-side file-write in Django's RasterField that can lead to remote code execution, plus six other issues.

Illustration: Django logo
Illustration: Five Nines

Django maintainers said in a security release that Django 6.1.4, 6.0.11, and 5.2.20 fix seven security issues. The releases cover Django main, 6.1, 6.0, and 5.2, and the project encouraged all users to upgrade as soon as possible.

The highest-severity flaw is CVE-2026-124827, a server-side file write via RasterField assignment. Django's advisory says that if a developer assigns a raster data definition to RasterField with a user-supplied name and a non-default driver, GDAL may write a file to a location chosen by the attacker, which could lead to remote code execution depending on the driver. Since RasterField uses CharField as its default form field, any model with RasterField in the admin, a ModelForm, or a writable serializer exposed the flaw by default. Django's security policy rates the issue high.

The Hacker News reported in its coverage that Mohamed K. Fathy, who leads cybersecurity at Robusta Technology Group, gave the flaw the name Django4Shell. The publication gives the vulnerability a CVSS score of 9.0. The publication said the issue is an unresolved continuation of CVE-2026-87890, which in turn was an incomplete patch for CVE-2026-15307.

Fathy told The Hacker News that "the attacker controls the target path, file content, and filename via a crafted JSON raster body." This ability lets an attacker overwrite application source code, drop web shells into static directories, or corrupt configuration files. The Hacker News explained that by dropping .pth files into site-packages, an attacker can read secrets and environment variables, steal or change data, and move around the host or network, all without database access or a model.save() call. Fathy listed four preconditions: django.contrib.gis with a RasterField model, RasterField exposed via ModelForm or default admin, GDAL with the EHdr driver, and a writable target path. According to The Hacker News, three of these are met by default in a typical Django/GeoDjango deployment. Fathy added that the primary requirement is staff-level authentication.

Django's fix sets RasterField's default editable to False and raises GDALException whenever a dict or JSON string that specifies a non-default driver is assigned. Developers who need other drivers must wrap the definition in GDALRaster to mark it as trusted. Django's advisory says that the exception blocks only server-side file writes, but server-side request forgery remains possible when untrusted input is assigned to RasterField.

The releases also fix CVE-2026-132092, a high-severity possible SQL injection in the range and in lookup types; for the range lookup, Django now requires two right-side values. Django rated CVE-2026-115868, a cross-site scripting flaw in truncatechars_html, moderate, and CVE-2026-125673, a cache poisoning issue via dot segments in request paths, low. Two low-severity admin changelist information leaks, CVE-2026-119642 and CVE-2026-127929, and a low-severity heap buffer overflow in OGRGeometry.wkb, CVE-2026-132809, were also patched.

Administrators should upgrade to Django 6.1.4, 6.0.11, or 5.2.20 as soon as possible, and for CVE-2026-125673 clear any potentially affected caches after upgrading.

Sources: Django Project, The Hacker News

Lena Vasquez

Lena Vasquez covers vulnerabilities, breaches and identity for Five Nines. She writes from advisories, vendor bulletins and published reporting.

Corrections. Report an error to corrections@thefivenines.com. We list substantive corrections on the corrections page.