Django: RCE via GeoDjango RasterField server-side file write (CVE-2026-124827)
Severity: high · Patch status: patched · Since 2026-12-02 · CVE-2026-115868, CVE-2026-119642, CVE-2026-124827, CVE-2026-125673, CVE-2026-127929, CVE-2026-132092, CVE-2026-132809, CVE-2026-15307, CVE-2026-87890
Django issued security releases 6.1.4, 6.0.11 and 5.2.20 on 2026-12-02 with seven CVE fixes. CVE-2026-124827 lets a RasterField assignment with a user-controlled name and a non-default GDAL driver write files to attacker-chosen locations, which can lead to code execution depending on the driver. Django says RasterField falls back to a CharField form field, so the flaw is reachable by default wherever a RasterField appears in the admin, a ModelForm or a writable model serializer. RasterField is only implemented on PostGIS. Django rates the issue high; NVD gives CVSS 3.1 8.8 and CVSS 4.0 8.7. The fix makes RasterField non-editable by default and raises GDALException for dict or JSON definitions with a non-default driver. Trusted definitions can still be used by wrapping them in GDALRaster. Django warns that server-side request forgery remains possible if untrusted input is assigned to RasterField. Django's notice does not state a required privilege level for the non-admin paths. No exploitation was reported in the sources checked.
What to do
- Upgrade Django to 6.1.4, 6.0.11 or 5.2.20
- Find RasterField models exposed through the admin, ModelForms or writable serializers, and review who can reach them
- Treat any user-supplied RasterField input as untrusted; Django says SSRF remains even after the fix
- Wrap trusted raster definitions in GDALRaster rather than passing raw dicts or JSON with a non-default driver
Fixed versions
Sources
All live incidents on Threat Watch