CVE-2024-38875: Django Denial of Service Vulnerability via urlize and urlizetrunc

django Updated 02 Oct 2025

Summary

10/03/2025
Yes i
High
Not published

CVE-2024-38875: An issue was discovered in Django 4.2 before 4.2.14 and 5.0 before 5.0.7. Affects django across 2 version ranges.

>= 4.2.0, < 4.2.14 >= 5.0.0, < 5.0.7

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

Also tracked for

The same CVE-2024-38875 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 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, authentication, and URL routing. However, certain versions of Django are vulnerable to a denial of service attack due to improper handling of inputs with a large number of brackets in the urlize and urlizetrunc functions.

Vulnerability Detail

The vulnerability identified as CVE-2024-38875 affects Django versions 4.2 before 4.2.14 and 5.0 before 5.0.7. It arises from the urlize and urlizetrunc functions, which can be exploited by providing inputs containing an excessive number of brackets. This can lead to a denial of service, as the application may become unresponsive when processing such inputs. The issue is particularly concerning for applications that rely on user-generated content, as malicious users could exploit this vulnerability to disrupt service availability.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 4.2.0, < 4.2.14 4.2.14
  • >= 5.0.0, < 5.0.7 5.0.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 number of brackets allowed in user inputs before they are processed by urlize or urlizetrunc. This can help mitigate the risk of denial of service attacks until the package is updated.

Conclusion

The CVE-2024-38875 vulnerability in Django poses a significant risk of denial of service attacks through the urlize and urlizetrunc functions. It is crucial to update to the latest patched versions to mitigate this risk. Implementing input validation can serve as a temporary measure while awaiting updates.

See every vulnerability recorded for django →

Share this vulnerability

FAQ

CVE-2024-38875 is a vulnerability in Django that allows for a potential denial of service attack via the urlize and urlizetrunc functions when they receive inputs with a large number of brackets.

Django versions 4.2 before 4.2.14 and 5.0 before 5.0.7 are affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

If you cannot update Django immediately, implement input validation to limit the number of brackets in user inputs as a temporary workaround.

The main consequence of this vulnerability is a denial of service, which can render your application unresponsive and affect user experience.

Related vulnerabilities

Recent vulnerabilities recorded for django.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 4.2.0, < 4.2.14 4.2.14
  • >= 5.0.0, < 5.0.7 5.0.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