A Map Upload Field That Can Write Files Anywhere: The Spec Sheet on Django4Shell, Plus a Patch Checklist
Django’s maintainers have shipped 6.1.4, 6.0.11 and 5.2.20 to fix seven security bugs, led by Django4Shell, a file-write flaw in GeoDjango that can lead to remote code execution. Here are the key facts and a checklist for anyone running Django applications.
Django, the popular open-source Python web framework, has released security updates for seven vulnerabilities. The most serious is a GeoDjango flaw its finder calls Django4Shell, which can let an authenticated user write files to the server and, in many setups, run code. The details below are from The Hacker News and SecurityWeek.
Spec sheet
- Identifier: CVE-2026-124827, nicknamed Django4Shell by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group.
- Severity: Reported as CVSS 9.0 by The Hacker News, which calls it critical. SecurityWeek lists 8.8 and calls it high severity.
- Component: GeoDjango (django.contrib.gis), specifically assignment to a RasterField.
- What goes wrong: Raster data with a user-controlled name parameter and a non-default driver can make the GDAL library write a file to a location the attacker chooses. Django’s advisory says this could allow remote code execution, depending on the raster driver.
- Why it is reachable by default: RasterField falls back to the CharField form field, so the flaw is exposed on models with a RasterField registered in the admin, or used through ModelForms or writable model serializers.
- Who has to be logged in: Fathy says the main requirement is staff-level authentication.
- History: This is an incomplete fix for CVE-2026-87890, an SSRF issue patched in October, which was itself an incomplete fix for CVE-2026-15307, a file-write bug patched in August.
- Public details: SecurityWeek reports that proof-of-concept details are publicly available.
- Fixed versions: Django 6.1.4, 6.0.11 and 5.2.20.
- Also fixed in this release: SQL injection in range and in lookups (CVE-2026-132092), possible cross-site scripting in the truncatechars_html template filter (CVE-2026-115868), cache poisoning via dot segments in request paths (CVE-2026-125673), and, according to SecurityWeek, information disclosure and heap buffer overflow issues.
How an attack would work
According to Fathy, a crafted JSON raster body lets the attacker control the target path, the file contents and the file name. That is enough to overwrite application code, put web shells in static directories or corrupt configuration files. One example he gives is writing a sitecustomize.py file into the worker’s working directory. Python loads that file automatically at startup, so the payload runs with the web server user’s privileges the next time the development server reloads, a gunicorn worker forks, a management cron job runs or a subprocess starts. He adds that this can happen without any database interaction.
Are you exposed? Four conditions
Fathy lists four preconditions and says three are met by default in a standard Django/GeoDjango deployment:
- GeoDjango with a model that uses RasterField. This is common in government, mapping, GIS, agricultural and environmental platforms.
- That field exposed through a ModelForm or the default admin, which Django generates automatically for registered models.
- A GDAL build that includes the EHdr driver, which ships in every standard build.
- A writable target path. The project’s working directory is writable and is usually on Python’s import path.
His advice: organizations running GeoDjango with raster data, standard admin access and a default GDAL build should assume they are exposed until they patch.
Patch checklist
- Find every Django application you run or pay someone to run, including internal tools and customer portals, and record each version.
- Upgrade to 6.1.4, 6.0.11 or 5.2.20, depending on your release line. If you are on an older line that is no longer supported, plan a move to a supported one.
- Even if you don’t use GeoDjango, apply the update, because the same release fixes SQL injection, cross-site scripting and cache poisoning bugs.
- If you use RasterField, check whether it appears in the admin, in ModelForms or in writable API serializers, and remove it from forms that don’t need it.
- Review who has staff accounts in the Django admin. Remove old accounts and require multi-factor authentication for the ones that remain.
- Look for unexpected sitecustomize.py or .pth files, and for files in static directories that don’t belong there.
- Run the web application under a low-privilege account, and keep the code directory read-only where your deployment allows it.
What this means for your company
Many small businesses run Django without knowing it, inside a booking system, a client portal or a custom app a contractor built years ago. Ask your developer or hosting provider which framework and version your web applications use and when they were last updated. Make framework security releases part of a regular patch schedule, not something handled only after an incident. Because this flaw requires a logged-in staff user, the security of your admin accounts is part of your defense: unique passwords, multi-factor authentication and quick removal of accounts when people leave.
If you’d like help taking inventory of your web applications and keeping their frameworks patched, we can help. Reach out to Layer 7 Data Solutions to discuss how we’ve helped companies similar to yours.
