CVE-2025-26699: Django Denial-of-Service Vulnerability Due to Resource Allocation Issues
Summary
CVE-2025-26699: Django vulnerable to Allocation of Resources Without Limits or Throttling. 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
- django · Bitnami
- python-django · Debian:11
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.
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.
No signup required · Results in about 60 seconds
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 methods within Django, such as django.utils.text.wrap() and the wordwrap template filter, are susceptible to denial-of-service attacks when processing excessively long strings, leading to potential resource exhaustion.
Vulnerability Detail
An issue was discovered in Django versions 4.2 before 4.2.20, 5.0 before 5.0.13, and 5.1 before 5.1.7. The vulnerability arises from the django.utils.text.wrap() method and the wordwrap template filter, which do not impose limits on the length of strings they process. This oversight can be exploited by attackers to send very long strings, potentially leading to a denial-of-service condition as the application consumes excessive resources while attempting to handle these inputs.
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.204.2.20pip install --upgrade "django==4.2.20" -
>= 5.0, < 5.0.135.0.13pip install --upgrade "django==5.0.13" -
>= 5.1, < 5.1.75.1.7pip 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 processed by the wrap() method and wordwrap template filter. For example, you can create a custom function that checks the length of the input string before passing it to these methods. Here is a sample code snippet:
def safe_wrap(text, width):
if len(text) > 1000: # Limit string length to 1000 characters
raise ValueError('Input string is too long')
return django.utils.text.wrap(text, width)
Conclusion
The Django vulnerability CVE-2025-26699 poses a risk of denial-of-service attacks due to improper handling of long strings in specific methods. It is crucial to update to the latest patched versions to mitigate this risk. Implementing input validation can serve as a temporary measure until the update is completed.
See every vulnerability recorded for django →
FAQ
Django versions 4.2 before 4.2.20, 5.0 before 5.0.13, and 5.1 before 5.1.7 are affected by this vulnerability.
The vulnerability has a CVSS score of 5.0, indicating a moderate severity level.
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 without requiring signup.
If exploited, this vulnerability can lead to denial-of-service conditions, causing your application to become unresponsive due to excessive resource consumption.
Yes, you can implement input validation to restrict the length of strings processed by the vulnerable methods as a temporary workaround.
Related vulnerabilities
Recent vulnerabilities recorded for django.