/

CVE-2026-15307

Severity:

HIGH RISK

(8.8)

Arbitrary File Write (CWE-73) in Django GeoDjango GIS

CVE-2026-15307

Analyzed

Vulnerability type

Category:

Arbitrary File Write and Server-Side Request Forgery

CWE:

CWE-73, CWE-918

Impact:

Arbitrary File Write and Server-Side Request Forgery

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A GeoDjango spatial lookup issue can cause attacker-controlled values to be interpreted as raster data sources, enabling arbitrary file creation or outbound network requests through GDAL handlers. The risk is present when untrusted lookup values reach the GDALRaster constructor, such as through a Django admin query string, and a written file is later loaded or imported by the application.

Affected context

The issue occurs in Django deployments using GeoDjango spatial lookups against GeometryField or RasterField values. A relevant input may be supplied through an administrative filtering interface by a staff user with view permission, although the exact exposure depends on application routing, permissions, and enabled GDAL drivers. The risk is greater when the application process can write to sensitive locations or when GDAL virtual filesystem handlers permit outbound connections.

Exploit preconditions

  • Attack surface: GeoDjango spatial lookup handling, including administrative changelist filters
  • Required access: Access sufficient to submit a value used in a spatial-field lookup, such as staff-level view permission in the Django admin
  • Trigger point: Processing the lookup's right-hand-side value through the GDALRaster constructor
  • Why exploitation is possible: Dictionary values or JSON-formatted strings may be treated as writable raster sources, while other strings may be interpreted as GDAL data sources capable of network access
  • Additional impact condition: Arbitrary file write may become code execution if the destination is later imported or executed by the application

Why this happens

GeoDjango optimistically interprets the right-hand side of spatial lookups as raster input before sufficiently constraining its type, source, or destination. Passing attacker-influenced values to GDALRaster can activate file-backed drivers in write mode or virtual filesystem handlers that perform network access. This reflects CWE-73: External Control of File Name or Path, because untrusted input can influence filesystem targets, and is also related to CWE-918: Server-Side Request Forgery when datasource processing causes outbound requests.

Potential impact

  • An attacker may write files with chosen names and contents
  • The application may make outbound requests to attacker-selected or internal destinations
  • Sensitive local or cloud services could be reached through GDAL network handlers
  • A written file could enable remote code execution if it is later imported or executed
  • Application data or deployment integrity could be compromised

General mitigation guidance

Mitigation generally focuses on reducing trust in spatial lookup inputs and preventing parser or driver behavior from selecting arbitrary resources.

Common defensive patterns include:

  • Restricting spatial lookup values to explicitly validated geometry or raster types
  • Avoiding implicit conversion of arbitrary strings and mappings into GDAL data sources
  • Allowing only approved GDAL drivers and disabling unnecessary virtual filesystem handlers
  • Constraining file operations to dedicated, non-executable directories with controlled permissions
  • Applying outbound network restrictions to application and worker processes
  • Running Django processes with least-privilege filesystem and network access
  • Separating uploaded or generated files from Python import paths and executable locations

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis rules identifying untrusted values passed to GDALRaster or similar datasource constructors
  • Code review checks for spatial lookup coercion that occurs before type, path, or driver validation
  • Tests using hostile path-like, JSON-like, and remote datasource values in GeometryField and RasterField filters
  • Runtime monitoring for unexpected file creation, GDAL virtual filesystem access, and outbound connections from web or worker processes
  • Policy enforcement that restricts writable directories, executable imports, approved GDAL drivers, and application egress

Automated security review tools may help identify dangerous dataflow paths, but deployment-level filesystem and network controls remain important.

Sources

SourceLink
docs.djangoproject.comdocs.djangoproject.com/en/dev/releases/security/
github.comgithub.com/django/django/commit/115ffd0463a765ab1cc93de18e94b5459b8a300e
github.comgithub.com/django/django/commit/208f80cb682868b584ed0a78f23e4ba6304212aa
github.comgithub.com/django/django/commit/39b3e2d0c743a338def6c473086ebc06865e86b6
github.comgithub.com/django/django/commit/f1949c1f9758947ade984c895ff16bef46f56520
groups.google.comgroups.google.com/g/django-announce
djangoproject.comdjangoproject.com/weblog/2026/aug/04/security-releases/

Frequently asked

questions

It may be exploitable through an exposed spatial lookup interface, such as an administrative filter, when an attacker has sufficient permission to submit lookup values. Exposure depends on application configuration, routing, and access controls.

In the described administrative scenario, the attacker needs staff-level access with view permission. Other application-specific lookup endpoints could have different requirements.

Treat spatial lookup values as untrusted, validate them against strict expected types and formats, and prevent arbitrary GDAL datasource or file-driver behavior from being selected by user input.

Combine strict input validation with least-privilege filesystem permissions, restricted GDAL drivers, outbound network controls, and tests that cover file-backed and remote datasource interpretations.

Find out what's already
exploitable in your codebase.