CVE-2024-27351: Regular expression denial-of-service in Django

django Updated 02 Oct 2025

Summary

15/03/2024
Yes i
Moderate
5.3

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

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.

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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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.25 3.2.25
    pip install --upgrade "django==3.2.25"
  • >= 4.2, < 4.2.11 4.2.11
    pip install --upgrade "django==4.2.11"
  • >= 5.0, < 5.0.3 5.0.3
    pip 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 →

Share this vulnerability

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.

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.

  • >= 3.2, < 3.2.25 3.2.25
    pip install --upgrade "django==3.2.25"
  • >= 4.2, < 4.2.11 4.2.11
    pip install --upgrade "django==4.2.11"
  • >= 5.0, < 5.0.3 5.0.3
    pip 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 →

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