CVE-2026-1285: Django Denial-of-Service Vulnerability Due to Inefficient Algorithmic Complexity

django Updated 23 Feb 2026

Summary

03/02/2026
Yes i
Low
2.7

CVE-2026-1285: Django has Inefficient Algorithmic Complexity. Affects django across 3 version ranges.

>= 4.2a1, < 4.2.28 >= 5.2a1, < 5.2.11 >= 6.0a1, < 6.0.2

Fixed in 4.2.28, 5.2.11 or 6.0.2, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2026-1285 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It is widely used for building web applications and provides a robust set of features, including an ORM, authentication, and an admin interface. However, certain versions of Django are vulnerable to an issue that can lead to denial-of-service attacks when handling specific HTML inputs.

Vulnerability Detail

An issue was discovered in Django versions 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28. The vulnerability lies in the django.utils.text.Truncator.chars() and Truncator.words() methods when the html parameter is set to True. Attackers can exploit this by sending crafted inputs containing a large number of unmatched HTML end tags, potentially leading to a denial-of-service condition. Unsupported versions such as 5.0.x, 4.1.x, and 3.2.x may also be affected, although they have not been evaluated.

How To Fix

Latest published version: 6.1.2 as of 22 Oct 2026

pip install --upgrade "django==6.1.2"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 4.2a1, < 4.2.28 4.2.28
    pip install --upgrade "django==4.2.28"
  • >= 5.2a1, < 5.2.11 5.2.11
    pip install --upgrade "django==5.2.11"
  • >= 6.0a1, < 6.0.2 6.0.2
    pip install --upgrade "django==6.0.2"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid using the html=True parameter in the Truncator.chars() and Truncator.words() methods, as well as the truncatechars_html and truncatewords_html template filters until the package is updated.

Conclusion

In summary, Django has a vulnerability that can lead to denial-of-service attacks due to inefficient algorithmic complexity in certain methods when handling HTML inputs. It is crucial to update to the patched versions to mitigate this risk.

See every vulnerability recorded for django →

Share this vulnerability

FAQ

Django versions 6.0 before 6.0.2, 5.2 before 5.2.11, and 4.2 before 4.2.28 are affected. Unsupported versions like 5.0.x, 4.1.x, and 3.2.x may also be vulnerable.

The vulnerability can lead to denial-of-service attacks, causing the application to become unresponsive when processing crafted HTML inputs.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Yes, you can mitigate the risk by avoiding the use of the html=True parameter in the affected methods and filters until you can apply the update.

The CVSS score of this vulnerability is 2.7, indicating a low severity level.

Related vulnerabilities

Recent vulnerabilities recorded for django.

How To Fix

Latest published version: 6.1.2 as of 22 Oct 2026

pip install --upgrade "django==6.1.2"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 4.2a1, < 4.2.28 4.2.28
    pip install --upgrade "django==4.2.28"
  • >= 5.2a1, < 5.2.11 5.2.11
    pip install --upgrade "django==5.2.11"
  • >= 6.0a1, < 6.0.2 6.0.2
    pip install --upgrade "django==6.0.2"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback