DarkReading

Django4Shell Vulnerability CVE-2026-124827 Allows RCE


Django has released versions 6.1.4, 6.0.11, and 5.2.20 to fix seven security flaws. The most serious Django4Shell vulnerability is CVE-2026-124827, which has been called the Django4Shell vulnerability. It could enable Django RCE. 

Jacob Walls announced the releases on December 2, 2026, under the project’s security release policy. “We encourage all users of Django to upgrade as soon as possible,” the team said. 

How the Django4Shell Vulnerability Works 

CVE-2026-124827 is rated “high” severity and affects django.contrib.gis.db.models.RasterField. If a raster data definition had a user-controlled name parameter and a non-default driver, assigning it to the field could make GDAL write a file to a location the attacker chose. Depending on the driver, that could escalate to Django RCE. 

RasterField falls back to the CharField form field. Because of this, the flaw was reachable by default on any model with a RasterField that was registered in the admin or used in ModelForms or writable model serializers. Geometry fields were not affected, and RasterField exists only on PostGIS. Mohammed Fathy reported the issue. 

How CVE-2026-124827 Was Fixed 

RasterField now defaults editable to False, so it is left out of ModelForms unless a developer adds it. Assigning a dict or JSON string that specifies a non-default driver now raises GDALException. To use other drivers, developers must wrap the definition in GDALRaster to mark it as trusted. 

The fix only blocks file writes. Server-side request forgery is still possible with untrusted input, so developers should review the raster security considerations and validate input first. 

Six Other Flaws Patched Alongside Django4Shell 

  • CVE-2026-132092 (high): SQL injection in range and in lookups on queries with aliases or key transforms that contain percent signs. The __range flaw needed more than two right-hand side values, and exactly two are now required. The __in flaw needed a bilateral transform. These percent signs were deprecated in Django 6.0 and are scheduled for removal in Django 2028. Reported by Cristian Panaro. 
  • CVE-2026-115868 (moderate): Possible XSS in truncatechars_html and Truncator.chars() with html=True. It occurred when input whose text length matched the truncation length was rendered in an HTML attribute. Reported by JoeCyberTech. 
  • CVE-2026-125673 (low): Cache poisoning in UpdateCacheMiddleware and cache_page(). build_absolute_uri() wrongly normalized “.” and “..” segments, so in some setups unauthenticated attackers could get cached responses served for unintended URLs. Dot segments are now preserved. Existing caches are not cleared automatically, so users should clear them after upgrading. Reported by 4drez. 
  • CVE-2026-119642 (low): Staff with view permissions could enumerate data in the admin changelist through the “pk” alias on models with a custom OneToOneField primary key. Multi-table inheritance models were affected by default. Reported by JoeCyberTech. 
  • CVE-2026-127929 (low): Similar enumeration through reverse relations, which requires knowing related model names or related_query_name overrides. The bug came back as a regression in Django 5.0.3. Reported by OpenAI. 
  • CVE-2026-132809 (low): A heap buffer overflow in OGRGeometry.wkb for geometries over 4GB on 64-bit platforms, which could cause segmentation faults or undefined behavior. The hex and geos properties and pickling were also affected, reported by Zhixi “Jace” Sun. 

Both admin flaws are special cases of CVE-2010-4534. 

Patching the Django RCE Flaw and Others 

Fixes for the Django4Shell vulnerability and the other six bugs cover the main, 6.1, 6.0, and 5.2 branches. The releases are signed with Walls’ PGP key, ID 131403F4D16D8DC7. Security issues should be reported privately to [email protected], not through Trac or the Django Forum. 



Source link