CVE-2023-23969

7.5 HIGH

📋 TL;DR

This vulnerability in Django allows attackers to cause denial-of-service by sending HTTP requests with extremely large Accept-Language headers, which Django caches in memory. This affects Django applications running vulnerable versions that accept HTTP requests with Accept-Language headers. The vulnerability can lead to excessive memory consumption and potential service disruption.

💻 Affected Systems

Products:
  • Django
Versions: Django 3.2 before 3.2.17, 4.0 before 4.0.9, and 4.1 before 4.1.6
Operating Systems: All operating systems running Django
Default Config Vulnerable: ⚠️ Yes
Notes: All Django installations using affected versions are vulnerable if they process HTTP requests with Accept-Language headers.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability due to memory exhaustion, requiring server restart and potentially causing extended downtime.

🟠

Likely Case

Degraded performance and intermittent service disruptions as memory consumption increases with repeated malicious requests.

🟢

If Mitigated

Minimal impact with proper request filtering and memory monitoring in place.

🌐 Internet-Facing: HIGH - Internet-facing Django applications are directly exposed to this attack vector.
🏢 Internal Only: MEDIUM - Internal applications are still vulnerable but attack surface is reduced.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending HTTP requests with large Accept-Language headers, which is trivial to implement.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Django 3.2.17, 4.0.9, or 4.1.6

Vendor Advisory: https://docs.djangoproject.com/en/4.1/releases/security/

Restart Required: Yes

Instructions:

1. Upgrade Django to version 3.2.17, 4.0.9, or 4.1.6 or higher. 2. Update requirements.txt or pip install: 'pip install Django==4.1.6' (or appropriate version). 3. Restart the Django application server.

🔧 Temporary Workarounds

Web Server Request Filtering

all

Configure web server (nginx, Apache) to reject or limit Accept-Language header size

nginx: add 'large_client_header_buffers 4 8k;' to http/server block
Apache: use mod_headers to limit Accept-Language size

Django Middleware Filtering

all

Implement custom middleware to validate Accept-Language header size

Create middleware class with process_request method that checks request.META.get('HTTP_ACCEPT_LANGUAGE') length

🧯 If You Can't Patch

  • Implement web application firewall (WAF) rules to block requests with large Accept-Language headers
  • Monitor memory usage and set up alerts for abnormal consumption patterns

🔍 How to Verify

Check if Vulnerable:

Check Django version: 'python -m django --version' or inspect requirements.txt

Check Version:

python -m django --version

Verify Fix Applied:

Confirm Django version is 3.2.17+, 4.0.9+, or 4.1.6+ after upgrade

📡 Detection & Monitoring

Log Indicators:

  • Multiple requests with unusually large Accept-Language headers
  • Memory usage spikes in Django process logs

Network Indicators:

  • HTTP requests with Accept-Language headers exceeding normal size (typically > 1KB)

SIEM Query:

source="web_logs" AND http_user_agent="*" AND http_accept_language="*" | stats count by src_ip | where count > threshold

🔗 References

📤 Share & Export