Django4Shell CVE-2026-124827: How to Audit and Patch Django

A framework vulnerability is announced. Your dependency scanner starts generating alerts. Several development teams ask whether their applications are affected.

Where should you start?

The December 2, 2026 Django security release provides an interesting example of why vulnerability management requires more than checking package versions.

What is Django4Shell?

Django4Shell is the name given to CVE-2026-124827, a server-side file-write vulnerability involving GeoDjango's RasterField.

Under certain conditions, the vulnerability can lead to remote code execution.

Django classifies the issue as high severity.

However, the affected component is specific. An ordinary Django application that does not use RasterField does not have this particular exposure.

Which versions should you upgrade to?

The December 2 security release introduced the following fixed versions:

Django branch Fixed release
6.1 6.1.4
6.0 6.0.11
5.2 5.2.20

Use the appropriate patched release for your supported branch, or a later supported security release.

Applications running unsupported Django versions need a migration plan rather than an assumption that their older version is unaffected.

Step 1: Check your installed version

Activate the relevant Python environment and run:

python -m django --version 

Alternatively:

python -m pip show Django 

You can also inspect the version directly:

python -c "import django; print(django.get_version())" 

The important part is checking the environment that actually runs the application.

Your development laptop and production container may contain different dependency versions.

Step 2: Audit your application

Search an authorized application repository for GeoDjango-related code:

grep -rn "RasterField" --include='*.py' . grep -rn "django.contrib.gis" --include='*.py' . 

Review any relevant models and migrations.

If RasterField is present, investigate whether the application accepts untrusted raster data.

Review input validation and restrict unnecessary write access.

This assessment helps prioritize the rollout. It should not replace the security upgrade.

Step 3: Update your dependency

For an application using the Django 5.2 branch, an illustrative requirements.txt entry is:

Django==5.2.20 

Adapt the dependency constraint to your application's supported branch and dependency-management workflow.

If you use a lock file, regenerate it using the project's existing tooling.

Run the application's automated tests before releasing the updated dependency.

Step 4: Rebuild your container

A dependency update in Git does not change existing container images.

An illustrative local build command is:

docker build -t django-app:security-update . 

Verify Django inside the newly built image:

docker run --rm \ --entrypoint python \ django-app:security-update \ -m django --version 

This assumes the image provides Python through the specified executable.

The reported version should correspond to the patched dependency.

Step 5: Verify Kubernetes deployments

After deploying the approved image through your existing release process, inspect the rollout:

kubectl rollout status deployment/django-web \ -n production --timeout=5m 

Inspect running image identities:

kubectl get pods -n production \ -o custom-columns='NAME:.metadata.name,IMAGE:.spec.containers[*].image,IMAGE_ID:.status.containerStatuses[*].imageID' 

Replace the namespace and deployment names with those used in your environment.

A successful web deployment does not prove that background workers have also been updated.

Include worker deployments, scheduled jobs and other Python services in the verification process.

Step 6: Test application compatibility

The security release changes RasterField's default editability and introduces stricter handling of raster assignments.

Applications should test:

  • Django admin pages.
  • ModelForms.
  • API serializers.
  • Trusted raster ingestion.
  • Background processing jobs.

Do not restore unrestricted input handling simply to recover previous application behavior.

Django also notes that untrusted raster input still requires validation because the file-write fix does not eliminate every associated security risk.

Step 7: Review the rollback plan

Avoid rolling back to a container image containing a vulnerable Django version.

Keep an approved, compatible and patched fallback artifact available.

If suspicious application activity was discovered before the upgrade, follow your incident-response procedures. Patching alone does not establish whether a workload was previously compromised.

Why applications without GeoDjango should upgrade

The December security release also addresses other vulnerabilities, including CVE-2026-132092, involving potential SQL injection under specific query conditions.

A narrow exposure assessment for Django4Shell is not a reason to postpone the wider security update.

Final thoughts

Dependency scanning identifies potential exposure.

Production verification establishes whether the updated software is actually running.

Both are necessary for closing a security ticket confidently.

For the complete exposure assessment, patch prioritization, temporary mitigations and SRE response guidance, read:

Django4Shell CVE-2026-124827: Who Is Exposed and How to Patch

Official reference:

Django security releases issued December 2, 2026.