Critical Django Vulnerability Allows Remote Code Execution via RasterField Exploit

A newly disclosed high-severity flaw in GeoDjango, named Django4Shell by researcher Mohammed Fathy, allows attackers to write arbitrary files to servers and achieve remote code execution through a crafted raster data input. The vulnerability exists in the RasterField assignment path within django.contrib.gis. Django maintainers have released security updates to address the issue.
A critical vulnerability identified as CVE-2026-124827, dubbed Django4Shell by researcher Mohammed Fathy, was disclosed on December 2, 2026, affecting GeoDjango’s RasterField functionality within Django versions 5.2, 6.0, and 6.1 prior to security updates. The flaw enables remote code execution through a crafted raster data input that exploits the file-writing behavior during RasterField assignment, allowing attackers to write arbitrary files to server paths accessible to the Django process. The vulnerability is rated High with a CVSS 3.1 score of 8.8, requiring network access, low attack complexity, and low privileges, though it does not require user interaction. The fix was released in Django 6.1.4, 6.0.11, and 5.2.20, with the Django Security Team emphasizing that exploitation requires the vulnerable field to be exposed via admin interfaces, ModelForms, or writable serializers—typically behind staff-level authentication. Organizations using GeoDjango in sectors like government, agriculture, environmental monitoring, and infrastructure are particularly at risk. The issue stems from the integration of GDAL drivers in raster data handling, where improper validation of filenames and drivers allowed path traversal and arbitrary file creation. The researcher’s analysis revealed that writing to directories like site-packages or application roots could lead to automatic code execution, turning file write into full system compromise. While the immediate fix is available, organizations must assess their deployments for exposure, especially those with public-facing admin interfaces or data ingestion forms. The broader ecosystem of Django users, particularly those not using GIS features, remain unaffected.
The impact of Django4Shell could be significant for organizations relying on geospatial data processing, especially in public infrastructure and environmental sectors where data integrity and system availability are critical. While the vulnerability requires specific conditions—exposed RasterField endpoints and authenticated access—it may still be exploited in environments with weak access controls or misconfigured admin interfaces. The incident underscores a recurring challenge in software ecosystems: the security risks introduced by powerful, under-monitored features like GeoDjango’s raster handling. Similar to past vulnerabilities such as Log4Shell, where a widely used library enabled remote code execution through a seemingly innocuous input, Django4Shell highlights how complex integrations can introduce high-impact flaws. The broader market may see increased demand for automated detection tools and threat intelligence platforms like SOC Prime, which offer AI-enhanced detection engineering to rapidly respond to emerging CVEs. Organizations may also reassess their use of third-party GIS components and prioritize patch management for less commonly monitored frameworks. What remains uncertain is the extent of real-world exploitation, as no public exploits or active attacks have been confirmed. However, the potential for supply chain compromise in GIS-heavy applications means defenders should monitor for anomalous file writes and suspicious activity in Django admin endpoints.