CVE-2024-27351: Regular expression denial-of-service in Django
Summary
CVE-2024-27351: Regular expression denial-of-service in Django. Affects django across 3 version ranges.
>= 3.2, < 3.2.25
>= 4.2, < 4.2.11
>= 5.0, < 5.0.3
Fixed in 3.2.25, 4.2.11 or 5.0.3, depending on the release line you run. How to fix ↓
Also tracked for
- django · Bitnami
- python-django · Debian:11
The same CVE-2024-27351 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 popular Python web framework that simplifies the development of web applications. It provides a wide range of features and tools for building secure and scalable websites. However, Django versions 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3 are vulnerable to a regular expression denial-of-service attack.
Vulnerability Detail
The vulnerability in Django exists in the django.utils.text.Truncator.words() method (with html=True) and the truncatewords_html template filter. An attacker can exploit this vulnerability by providing a crafted string, leading to a potential regular expression denial-of-service attack. This issue is a result of an incomplete fix for previously reported vulnerabilities, including CVE-2019-14232 and CVE-2023-43665. The impact of this vulnerability can result in a denial-of-service condition, causing the affected Django application to become unresponsive.
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.
-
>= 3.2, < 3.2.253.2.25pip install --upgrade "django==3.2.25" -
>= 4.2, < 4.2.114.2.11pip install --upgrade "django==4.2.11" -
>= 5.0, < 5.0.35.0.3pip install --upgrade "django==5.0.3"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to apply the recommended fix by upgrading Django to the patched version.
Conclusion
In conclusion, Django versions 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3 are vulnerable to a regular expression denial-of-service attack. It is crucial to upgrade to the patched versions to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for django →
FAQ
Django is a Python web framework that simplifies web application development.
Django versions 3.2 before 3.2.25, 4.2 before 4.2.11, and 5.0 before 5.0.3 are affected.
This vulnerability can lead to a denial-of-service condition, causing the affected Django application to become unresponsive.
No, there are no known workarounds. It is necessary to upgrade Django to the patched version.
To fix this vulnerability, upgrade Django to version 3.2.25, 4.2.11, or 5.0.3.
References
Related vulnerabilities
Recent vulnerabilities recorded for django.