Patch available CVSS 8.8 Security news
Django 6.1.4, 6.0.11 and 5.2.20: seven security fixes, led by a file write through RasterField
On 2 December 2026 the Django project released versions 6.1.4, 6.0.11 and 5.2.20, fixing seven vulnerabilities. The most serious is CVE-2026-124827 in GeoDjango: the RasterField model field on PostGIS lets an authenticated attacker make the GDAL library write a file to a location of their choosing and, depending on the driver, potentially run code. A SQL injection in range and in lookups is also rated high. Django reports no exploitation. Some outlets have dubbed the bug “Django4Shell”.
Key points
- Affected: Django 6.1, 6.0 and 5.2 (plus the main branch); fixed in 6.1.4, 6.0.11 and 5.2.20, released 2 Dec 2026.
- Worst: CVE-2026-124827 (CVSS 3.1 score 8.8 in the NVD record) – RasterField lets GDAL write a file anywhere, which may lead to code execution depending on the driver.
- Second high-severity bug: CVE-2026-132092, SQL injection in __range and __in lookups, but only under unusual conditions (aliases containing %).
- Five other fixes (XSS, cache poisoning, admin data leaks, a buffer overflow) are moderate or low. Clear your caches after upgrading.
Vulnerabilities: CVE-2026-124827, CVE-2026-132092, CVE-2026-115868, CVE-2026-125673, CVE-2026-119642, CVE-2026-127929, CVE-2026-132809
What happened
On 2 December 2026 the Django project announced security releases 6.1.4, 6.0.11 and 5.2.20. They fix seven vulnerabilities across every supported series (6.1, 6.0, 5.2) and the main development branch. Django rates two of them high, one moderate and four low. The NVD record for the most serious one went live the same day.
Django runs a large share of Python web applications, from content management systems to internal portals, so we are covering this even though nobody has reported exploitation yet.
Technical details
CVE-2026-124827 – file write via RasterField (high). GeoDjango's RasterField (PostGIS only) accepts a raster definition as a dict or JSON string. If an attacker controls its name entry and picks a non-default GDAL driver, GDAL writes a file to a location the attacker chooses. Depending on the driver, Django says this could lead to remote code execution. What makes it worse is that RasterField falls back to a plain text form field, so it was reachable by default in the admin, in ModelForms and in writable API serializers.
NVD carries the CNA's CVSS 3.1 score of 8.8 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) and a CVSS 4.0 score of 8.7, with weakness CWE-73 (external control of file name or path). The fix makes editable default to False and rejects dicts or JSON with a non-default driver. Django explicitly warns that SSRF is still possible if you assign untrusted input to a RasterField, so you need to add your own validation.
CVE-2026-132092 – SQL injection in __range and __in (high). This affects queries whose aliases or key transforms contain a percent sign. The __range case required more than two right-hand values; the __in case required a bilateral transform. The range lookup now accepts exactly two values.
Other fixes:
| CVE | Severity (Django) | What |
|---|---|---|
| CVE-2026-115868 | moderate | XSS in the truncatechars_html filter when output lands in an HTML attribute |
| CVE-2026-125673 | low | cache poisoning via . and .. path segments (cache_page, UpdateCacheMiddleware) |
| CVE-2026-119642 | low | admin changelist data leak via the pk alias on a OneToOneField (staff with view permission) |
| CVE-2026-127929 | low | admin changelist data leak via reverse relations; a regression since Django 5.0.3 |
| CVE-2026-132809 | low | heap overflow in OGRGeometry.wkb for geometries over 4 GB on 64-bit systems |
Who is affected
- Django 6.1 before 6.1.4, 6.0 before 6.0.11 and 5.2 before 5.2.20. According to NVD, the unsupported 5.1, 5.0 and 4.2 series were not evaluated and may be affected too.
- CVE-2026-124827 only affects projects using
django.contrib.giswith PostGIS and a model with aRasterFieldthat can receive user input (admin, forms or API). - CVE-2026-132092 only affects code that uses aliases or key transforms containing
%, which have been deprecated since Django 6.0.
Quick check: search your codebase for RasterField and confirm your version with pip show django.
How to tell if you were compromised
Django has not published indicators of compromise. As a defensive review, look at:
- recently created files outside the usual directories that are owned by the user your application runs as (especially in web roots, template directories and application code),
- logged POST requests to forms or APIs exposing a RasterField that contain raster definitions with
driverandnamekeys instead of ordinary data, - unexpected outbound connections from the application server (the remaining SSRF risk).
What to do
- Upgrade to Django 6.1.4, 6.0.11 or 5.2.20 (for example
pip install -U "django==6.1.4"for your series). Move unsupported series to a supported release. - If you use RasterField, check where it appears in forms and serializers, and do not let user input reach it without validation. Wrap trusted data in
GDALRaster. - Clear page caches after upgrading – Django notes that the fix does not invalidate responses that were already cached (CVE-2026-125673).
- Work through the checks in the previous section.
- To compare patch priorities, try our CVSS calculator.
Timeline
- 2 Dec 2026 – Django releases 6.1.4, 6.0.11 and 5.2.20 with seven fixes.
- 2 Dec 2026, 14:17 UTC – NVD publishes CVE-2026-124827.
- 2 Dec 2026 – Django reports no exploitation; the latest CISA KEV catalogue (30 Nov) predates the disclosure.
FAQ
Am I affected by CVE-2026-124827 if I don't use GeoDjango?
No. The bug lives only in django.contrib.gis.db.models.RasterField, which works only with a PostGIS database. Django says geometry fields (PointField, PolygonField and so on) are not affected. Upgrading is still worthwhile for the other six fixes.
Does an attacker need an account?
The NVD record scores it as requiring low privileges (PR:L), i.e. an authenticated user. In practice it depends on who can reach a form or API exposing a RasterField – if that is a public form, anyone may be enough.
Can the upgrade break anything?
Yes, for projects that use RasterField. The field now defaults to editable=False, so it disappears from ModelForms and the admin unless you add it explicitly. Assigning a dict or JSON string with a non-default GDAL driver now raises GDALException; wrap trusted data in GDALRaster instead.
Where does the name Django4Shell come from?
It is a media nickname. The Django project does not use it; its advisory describes the bug as a server-side file write via RasterField assignment.
Sources
Spotted a mistake? Let us know and we will correct it openly.