CVE-2024-41991: Django Denial-of-Service Vulnerability

django Updated 02 Oct 2025

Summary

07/08/2024
Yes i
Moderate
5.3

CVE-2024-41991: Django vulnerable to denial-of-service attack. Affects django across 2 version ranges.

>= 4.2, < 4.2.15 >= 5.0, < 5.0.8

Fixed in 4.2.15 or 5.0.8, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2024-41991 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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Django is a popular Python web framework known for its simplicity and versatility. It provides a robust set of tools and libraries for building web applications. However, versions 5.0 before 5.0.8 and 4.2 before 4.2.15 of Django are susceptible to a denial-of-service attack. This vulnerability affects the urlize and urlizetrunc template filters, as well as the AdminURLFieldWidget widget. Attackers can exploit this vulnerability by providing inputs with an excessive number of Unicode characters.

Vulnerability Detail

The Django vulnerability allows attackers to launch denial-of-service attacks against affected applications. By sending specially crafted inputs with a large number of Unicode characters, the urlize and urlizetrunc template filters, as well as the AdminURLFieldWidget widget, can be overwhelmed, leading to resource exhaustion and potential service disruption. This vulnerability poses a moderate risk to affected systems.

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.15 4.2.15
    pip install --upgrade "django==4.2.15"
  • >= 5.0, < 5.0.8 5.0.8
    pip install --upgrade "django==5.0.8"

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, developers can implement input validation and limit the number of Unicode characters allowed in the affected inputs. By enforcing reasonable limits, the risk of exploitation can be reduced. Here is an example of input validation in Python:

# Limit the number of Unicode characters to 1000
input_string = request.POST.get('input_string', '')
if len(input_string) > 1000:
    # Handle the error or truncate the input
    input_string = input_string[:1000]

Conclusion

The Django framework is vulnerable to a denial-of-service attack due to a flaw in the urlize and urlizetrunc template filters, as well as the AdminURLFieldWidget widget. Attackers can exploit this vulnerability by providing inputs with an excessive number of Unicode characters. It is crucial to update Django to the latest patched version to mitigate the risk of denial-of-service attacks.

See every vulnerability recorded for django →

Share this vulnerability

FAQ

The vulnerability allows attackers to launch denial-of-service attacks, potentially causing service disruption and resource exhaustion.

Versions 5.0 before 5.0.8 and 4.2 before 4.2.15 of Django are affected by this vulnerability.

To mitigate the risk, it is recommended to update Django to version 5.0.8 or later (for Django 5.0) or version 4.2.15 or later (for Django 4.2).

Yes, developers can implement input validation and limit the number of Unicode characters allowed in the affected inputs as a temporary workaround.

Yes, the CVSS score for this vulnerability is 5.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.

  • >= 4.2, < 4.2.15 4.2.15
    pip install --upgrade "django==4.2.15"
  • >= 5.0, < 5.0.8 5.0.8
    pip install --upgrade "django==5.0.8"

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