CVE-2026-1285

7.5 HIGH

📋 TL;DR

This vulnerability in Django allows remote attackers to cause denial-of-service by sending crafted inputs with many unmatched HTML end tags to specific text truncation functions. It affects Django versions 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28, potentially including earlier unsupported series.

💻 Affected Systems

Products:
  • Django
Versions: 6.0 before 6.0.2, 5.2 before 5.2.11, 4.2 before 4.2.28. Earlier unsupported series (5.0.x, 4.1.x, 3.2.x) may also be affected.
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using django.utils.text.Truncator.chars() or .words() with html=True, or truncatechars_html/truncatewords_html template filters.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service unavailability due to resource exhaustion from processing malicious inputs, potentially affecting all users of the Django application.

🟠

Likely Case

Degraded performance or temporary service disruption for affected endpoints using vulnerable truncation functions with HTML content.

🟢

If Mitigated

Minimal impact with proper input validation, rate limiting, and updated Django versions.

🌐 Internet-Facing: HIGH - Remote attackers can exploit without authentication by sending crafted requests to public endpoints.
🏢 Internal Only: MEDIUM - Internal users could still exploit, but attack surface is more limited.

🎯 Exploit Status

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

Exploitation requires sending crafted HTML with many unmatched end tags to vulnerable endpoints.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.0.2, 5.2.11, 4.2.28

Vendor Advisory: https://www.djangoproject.com/weblog/2026/feb/03/security-releases/

Restart Required: Yes

Instructions:

1. Identify Django version. 2. Upgrade to patched version: pip install Django==6.0.2 (or 5.2.11/4.2.28). 3. Restart Django application. 4. Test functionality.

🔧 Temporary Workarounds

Disable HTML truncation filters

all

Replace vulnerable truncatechars_html and truncatewords_html template filters with non-HTML alternatives or custom safe implementations.

Input validation and sanitization

all

Implement strict input validation to reject or sanitize HTML content with excessive unmatched tags before processing.

🧯 If You Can't Patch

  • Implement WAF rules to block requests with excessive HTML end tags
  • Apply rate limiting to endpoints using vulnerable truncation functions

🔍 How to Verify

Check if Vulnerable:

Check Django version and if application uses vulnerable truncation functions with html=True in code or templates.

Check Version:

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

Verify Fix Applied:

Confirm Django version is 6.0.2, 5.2.11, or 4.2.28 or higher using version check command.

📡 Detection & Monitoring

Log Indicators:

  • Unusually long processing times for requests with HTML content
  • High CPU/memory usage spikes from Django processes

Network Indicators:

  • Requests containing large numbers of HTML end tags (e.g., many </div> tags without opening tags)

SIEM Query:

source="django" AND (message="timeout" OR message="slow response") AND uri="*" AND user_agent!="*bot*"

🔗 References

📤 Share & Export