CVE-2025-26699: Django Denial-of-Service Vulnerability in Text Wrapping Functions

django Updated 02 Oct 2025

Summary

06/03/2025
Yes i
Moderate
5.0

CVE-2025-26699: An issue was discovered in Django 5.1 before 5.1.7, 5.0 before 5.0.13, and 4.2 before 4.2.20. Affects django across 3 version ranges.

>= 4.2, < 4.2.20 >= 5.0, < 5.0.13 >= 5.1, < 5.1.7

Fixed in 4.2.20, 5.0.13 or 5.1.7, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-26699 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 Your last release was probably never penetration tested 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 provides a robust set of features for building web applications, including an ORM, routing, templating, and security features. However, certain functions, such as django.utils.text.wrap() and the wordwrap template filter, can be exploited when handling excessively long strings, leading to potential denial-of-service attacks.

Vulnerability Detail

An issue was discovered in Django versions 5.1 before 5.1.7, 5.0 before 5.0.13, and 4.2 before 4.2.20. The vulnerability arises from the django.utils.text.wrap() method and the wordwrap template filter, which can be exploited with very long strings. This can lead to a denial-of-service condition, where the application may become unresponsive due to excessive resource consumption.

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.2, < 4.2.20 4.2.20
    pip install --upgrade "django==4.2.20"
  • >= 5.0, < 5.0.13 5.0.13
    pip install --upgrade "django==5.0.13"
  • >= 5.1, < 5.1.7 5.1.7
    pip install --upgrade "django==5.1.7"

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, you can implement input validation to restrict the length of strings passed to the wrap() method and wordwrap template filter. For example, you can truncate any input string longer than a specified limit before processing it.

Conclusion

The vulnerability identified as CVE-2025-26699 poses a significant risk to applications using affected versions of Django. It is crucial to update to the latest patched versions to mitigate the risk of denial-of-service attacks. Implementing input validation can serve as a temporary workaround while updates are being applied.

See every vulnerability recorded for django →

Share this vulnerability

FAQ

Django versions 5.1 before 5.1.7, 5.0 before 5.0.13, and 4.2 before 4.2.20 are affected.

The vulnerability allows for a potential denial-of-service attack when very long strings are processed by specific text wrapping functions.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Implement input validation to limit the length of strings processed by the vulnerable functions as a temporary measure.

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.2, < 4.2.20 4.2.20
    pip install --upgrade "django==4.2.20"
  • >= 5.0, < 5.0.13 5.0.13
    pip install --upgrade "django==5.0.13"
  • >= 5.1, < 5.1.7 5.1.7
    pip install --upgrade "django==5.1.7"

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