Django4Shell, CVE-2026-124827: One Admin Form Field Lets a Staff Login Write Python Onto Your GeoDjango Server. Upgrade to 6.1.4, 6.0.11 or 5.2.20 and Find Every RasterField
What to do first. Upgrade Django to 6.1.4, 6.0.11 or 5.2.20, released Wednesday, December 2, 2026. The Django project says these releases fix CVE-2026-124827 and six other issues, and "We encourage all users of Django to upgrade as soon as possible." All three are on PyPI now.
Who is exposed to this bug: sites that use GeoDjango (django.contrib.gis) and have a model with a RasterField that people can write to through the Django admin, a ModelForm, or a writable model serializer. Django's words: "Because RasterField falls back to the CharField form field, the flaw was reachable by default on models with RasterField registered in the admin or using ModelForms or writable model serializers."
Who is not exposed by this bug: sites that do not use RasterField. Django says plainly: "Geometry fields were not affected." If your GeoDjango project only stores points, lines and polygons (PointField, PolygonField, GeometryField and the GeoDjango geometry form fields), this CVE does not reach you. The same release still fixes a high-severity SQL injection that affects every Django site (see below), so upgrade anyway.
If you cannot upgrade today: take the RasterField out of every form a person can submit. Mark it editable=False, or exclude it from the ModelAdmin, the ModelForm and the serializer. That is exactly what the fix does by default. Then check your project directory and site-packages for files that should not be there (see "Am I affected?").
If you patched in October, you are not done. This is the third Django fix in four months for raster input in GeoDjango. CVE-2026-15307 (August 4) closed the spatial lookup path, CVE-2026-87890 (October 6) closed a gap in that fix, and CVE-2026-124827 closes the assignment path neither of them covered. Django 6.1.2, 6.0.9 and 5.2.18 from October are still vulnerable to this one.
What is confirmed
From the Django project's security release post (posted by Jacob Walls, December 2, 2026):
The bug, in Django's words: "Assigning a raster data definition to django.contrib.gis.db.models.RasterField with a user-controlled name parameter and a non-default driver could cause GDAL to write a file to an attacker-controlled location. Depending on the raster driver, this could enable remote code execution."
Severity: "high" under Django's own security policy. The Hacker News reports a CVSS score of 9.0; the Django post does not give a CVSS number, and the researcher's site calls it "Critical P1".
Affected supported versions: Django main, 6.1, 6.0 and 5.2. Fixed: 6.1.4, 6.0.11, 5.2.20. Fix commits are linked from the post for each branch (main a3934ab, 6.1 b70d098, 6.0 6b5d29e, 5.2 02d0944).
Database scope: "RasterField is only implemented on PostGIS."
What the fix changes: "RasterField now defaults editable to False, excluding it from a ModelForm unless explicitly included. RasterField also now raises GDALException when assigning a dict or JSON string specifying a non-default driver. To use other drivers, wrap the definition in GDALRaster to signify the value is trusted."
What the fix does not change: "This exception only limits server-side file writes. Server-side request forgery is still possible if untrusted input is assigned to RasterField." Django points to its raster security considerations page and says to validate input before accepting it. If you deliberately include a RasterField in a form after upgrading, the SSRF half is still yours to handle.
Credit: Django thanks Mohammed Fathy for the report. Fathy, of Robusta Technology Group, named it Django4Shell and published a write-up at django4shell.com.
From the researcher's write-up and his comments to The Hacker News:
Where the write happens: "The file write completes inside form.is_valid(). No model.save() or database is touched." His site adds that no PostGIS connection and no database table are needed for the write itself. That does not contradict Django: you still need a model with a RasterField, which in practice means a PostGIS project, but the attack does not have to reach the database.
What an attacker controls: "The attacker controls the target path, file content, and filename via a crafted JSON raster body," Fathy told The Hacker News. His example payload is a sitecustomize.py in the worker's working directory, which Python imports at startup, so the code runs on the next gunicorn worker fork, runserver reload, manage.py cron job or subprocess, as the web server user. He also names .pth files in site-packages, web shells in static directories and overwritten config.
The driver: GDAL's EHdr driver, which he says ships in every standard GDAL build (apt, yum, Homebrew, conda).
Who can do it: "The primary requirement is staff-level authentication." His exploit enters through the Django admin add or change view, or any ModelForm-backed view with a RasterField.
Public detail: his site steps through a 13-step exploit chain. As of December 2 our GitHub PoC harvester held no exploit repository for this CVE; we did not search further.
Also in the same release (all fixed by the same upgrade): CVE-2026-132092, SQL injection in the range and in lookups (high); CVE-2026-115868, XSS in truncatechars_html (moderate); CVE-2026-125673, cache poisoning via dot segments in request paths (low, and Django says to clear potentially affected caches after upgrading); two admin changelist information leaks, CVE-2026-119642 and CVE-2026-127929 (low); and CVE-2026-132809, a heap buffer overflow in OGRGeometry.wkb for geometries over 4GB (low).
What is not known
Whether anyone is exploiting it. It is not in CISA's Known Exploited Vulnerabilities catalog (we checked catalog version 2026.11.30, the current one on December 2). Neither Django nor the researcher reports exploitation. Not known exploited is not the same as safe: the exploit chain is now described in public.
Older Django versions. Django's post lists only supported series (main, 6.1, 6.0, 5.2). It does not say whether 4.2 or earlier, which no longer get security fixes, are affected. RasterField has existed for many Django releases, so our working assumption is that they are, and the only fix is moving to a supported series. That is our inference, not Django's statement.
Non-admin attackers. The researcher frames this as staff-level. If your app exposes a ModelForm or a writable API serializer with a RasterField to ordinary users, Django's wording ("ModelForms or writable model serializers") suggests whoever can submit that form can reach the bug. Nobody in the sources we read tested that case publicly; treat it as worse, not better.
How many sites are exposed. We did not count them. The researcher says RasterField is most common in government, mapping, GIS, agriculture and environmental platforms.
Indicators. None published in the sources we read, so we added nothing to our feed.
Am I affected?
Check the version. Run "pip show django" (or "python -m django --version") in every environment that runs your app, including containers and Celery workers. Fixed means 6.1.4 or later, 6.0.11 or later, or 5.2.20 or later. Anything on 6.1.0 to 6.1.3, 6.0.0 to 6.0.10, or 5.2.0 to 5.2.19 carries the bug. Check your lock file too (requirements.txt, poetry.lock, uv.lock, Pipfile.lock) so the next deploy does not roll you back.
Check whether you use RasterField. Search your code and your installed third-party apps: "grep -rn RasterField ." from the project root, and the same over your virtualenv's site-packages. No hits means this CVE does not reach you; upgrade for the rest of the release.
Do not stop at GeoDjango form imports. A grep for django.contrib.gis.forms will miss this: the vulnerable path is a RasterField model field rendered as a plain CharField form field, so the model, not the form import, is what to look for.
If you have a RasterField, find where it is writable. Is the model registered in admin.py without excluding the field? Does a ModelForm use fields = "__all__" or list the raster field? Does a Django REST Framework ModelSerializer (or similar) expose it without read_only? Each of those is a door.
Look for planted files. In the app's working directory and every site-packages directory on the server, look for a sitecustomize.py or usercustomize.py you did not put there, new .pth files, and new files in your static and media directories. GDAL's EHdr driver writes a raw data file plus a companion .hdr header, so an unexpected .hdr file in a code or static directory is a strong tell. Compare against your image or your package manager rather than trusting your memory.
Check who posted. In your admin logs and web server logs, look for POSTs to the add or change view of any model with a RasterField, especially from staff accounts that do not normally edit raster data. The payload is in the POST body, so a URL-only access log will show the request but not the raster JSON.
How we know, and what our edge saw
We read the Django security release post for December 2, 2026 directly on djangoproject.com, the August and October Django security posts for the two earlier raster CVEs, the researcher's site, The Hacker News article, the CISA KEV JSON, and PyPI's release list for Django.
Our edge check (scripts/ttp-check.js) had no harvested PoC fingerprint for this CVE, so we searched for the exploit's entry point instead: POSTs to Django admin add and change views (any path shaped like admin/app/model/add/ or admin/app/model/123/change/) from November 2 to December 2. Result: 0 matches in 699,776 edge-shield block records, 0 in 113,554 edge canary records, and 0 in 947 origin honeypot captures. None had to be discarded as our own /post/ pages. Read that zero as unknown, not as calm: we do not run Django and have no Django-shaped decoy, the attack needs a staff login first, and the malicious part lives in the POST body, which our edge records do not keep. An admin path in a log would not tell you whether the raster payload was in it.
Feed: none. No attacker infrastructure was published in the sources we read.
Sources
Django security releases issued: 6.1.4, 6.0.11, and 5.2.20 (December 2, 2026): https://www.djangoproject.com/weblog/2026/dec/02/security-releases/
Django security releases, October 6, 2026 (CVE-2026-87890): https://www.djangoproject.com/weblog/2026/oct/06/security-releases/
Django security releases, August 4, 2026 (CVE-2026-15307): https://www.djangoproject.com/weblog/2026/aug/04/security-releases/
GeoDjango raster security considerations: https://docs.djangoproject.com/en/stable/ref/contrib/gis/gdal/#security-considerations
Django4Shell write-up by Mohammed Fathy, Robusta Technology Group: https://django4shell.com/
The Hacker News, "New Django4Shell Vulnerability Enables..." (December 2026): https://thehackernews.com/2026/12/new-django4shell-vulnerability-enables.html
CISA KEV catalog JSON (checked version 2026.11.30): https://www.cisa.gov/known-exploited-vulnerabilities-catalog
Django on PyPI: https://pypi.org/project/Django/
Read next: another Django bug, already flagged as exploited, that the same upgrade habit fixes: Three Old Bugs Got Fresh Exploitation Flags This Week: ThinkPHP 5.0, a TOTOLINK Router and a Django SQL Injection.
Every indicator in this post is in the feed. Free.
1.58M+ IOCs, STIX 2.1 / TAXII, 88% novel vs ThreatFox, exploited-CVE leads ahead of CISA. No credit card — a free API key in 30 seconds, and you can audit every claim above against the live endpoints.



Comments