The maintainers of Django have released versions 6.1.4, 6.0.11, and 5.2.20 to address seven security vulnerabilities, including a critical security flaw that could potentially enable remote code execution.
Recent findings suggest that the vulnerability, tracked as CVE-2026-124827 (CVSS score: 9.0), has been codenamed Django4shell by Mohamed K. Fathy, head of cybersecurity at Robusta Technology Group. It's an incomplete fix for CVE-2026-87890, which, in turn, is an incomplete patch for an earlier concern (CVE-2026-15307) that was addressed in August 2026.
CVE-2026-15307 is a high-severity flaw in GeoDjango's ("django.contrib.gis") spatial lookup raster parsing mechanism that enables server-side file writes, potentially resulting in remote code execution.
The subsequent vulnerability, CVE-2026-87890, also targets the same module, but enables server-side request forgery (SSRF) by making use of crafted Geospatial Data Abstraction Library (GDAL) Virtual Raster (VRT) payloads that reference an external raster source.
Industry observers note that "This glitch could be exploited by applications that passed attacker-controlled bytes directly to a spatial lookup," Django maintainers said in the October 2026 release notes. "It was overlooked in the fix for CVE-2026-15307.".
"To mitigate this issue, raster values provided as bytes must now be wrapped in GDALRaster before being used in spatial lookups. Byte values representing valid hexadecimal geometries remain accepted. This is a backward incompatible change. As a reminder, all untrusted user input should be validated before use.".
CVE-2026-124827, the latest vulnerability, stems from the fact that the protections don't extend to the RasterField assignment path, enabling an attacker to obtain arbitrary file write and remote code execution primitives.
"The attacker controls the target path, file content, and filename via a crafted JSON raster body," Fathy told The Hacker News via email. "This allows overwriting application source code, dropping web shells into static directories, or corrupting configuration files.".
Recent findings suggest that "By writing sitecustomize.py into the worker's current working directory (typically on sys.path), the attacker plants a file that Python automatically imports at interpreter startup β before any application code runs. On the next runserver reload, gunicorn worker fork, manage.py cron job, or subprocess execution, the payload executes with the privileges of the web server OS user.".
An attacker can exploit this vulnerability to drop .pth files into site-packages, read secrets and environment variables, exfiltrate or modify data, and pivot into the host or network, without any database interaction or model.save() being ever called.
"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," Django maintainers noted in an advisory released today.
"Depending on the raster driver, this could enable remote code execution. 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.".
However, successful exploitation of the flaw hinges on four pre-conditions, three of which are satisfied by default in a standard Django/GeoDjango deployment, according to Fathy -.
Industry observers note that "The primary requirement is staff-level authentication," Fathy added. "If an application uses RasterField, the remaining conditions are almost certainly met by default. Organizations running GeoDjango with raster data, standard admin access, and a default GDAL build should consider themselves exposed until patched.".
Outside of CVE-2026-124827, the latest versions also address an SQL injection in range and in lookups (CVE-2026-132092), a potential cross-site scripting vulnerability (CVE-2026-115868) in the truncatechars_html template filter, and a cache poisoning flaw via dot segments in request paths (CVE-2026-125673).
Discover why SHA pinning alone isn't enough and learn how to close hidden security gaps in your GitHub Actions pipelines.
Learn what 6,000 real-world attacks reveal about MFA weaknesses and how to stop AI-driven phishing and account takeovers.
Get the latest news, expert insights, exclusive resources, and strategies from industry leaders, all for free.
