CVE-2025-32873: Django Denial-of-Service Vulnerability in strip_tags() Function

django Updated 02 Oct 2025

Summary

08/05/2025
Yes i
Moderate
5.3

CVE-2025-32873: Django has a denial-of-service possibility in strip_tags(). Affects django across 3 version ranges.

>= 4.2, < 4.2.21 >= 5.1, < 5.1.9 >= 5.2, < 5.2.1

Fixed in 4.2.21, 5.1.9 or 5.2.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-32873 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 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 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 templating. However, certain versions of Django are vulnerable to a denial-of-service attack due to inefficiencies in the strip_tags() function, which can lead to slow performance when processing specific inputs.

Vulnerability Detail

An issue was discovered in Django versions 4.2 before 4.2.21, 5.1 before 5.1.9, and 5.2 before 5.2.1. The vulnerability lies in the django.utils.html.strip_tags() function, which is susceptible to denial-of-service attacks when handling inputs with large sequences of incomplete HTML tags. This can result in significant slowdowns, affecting the application's responsiveness and user experience.

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.21 4.2.21
    pip install --upgrade "django==4.2.21"
  • >= 5.1, < 5.1.9 5.1.9
    pip install --upgrade "django==5.1.9"
  • >= 5.2, < 5.2.1 5.2.1
    pip install --upgrade "django==5.2.1"

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 filter out potentially problematic HTML tags before they are processed by the strip_tags() function. This can help mitigate the impact of the vulnerability until an upgrade is performed.

Conclusion

In summary, the CVE-2025-32873 vulnerability in Django's strip_tags() function poses a risk of denial-of-service attacks due to inefficient handling of certain inputs. It is crucial to update to the latest patched versions to ensure the security and performance of your applications.

See every vulnerability recorded for django →

Share this vulnerability

FAQ

The CVSS score for this vulnerability is 5.3, indicating a moderate severity level.

Django versions 4.2 before 4.2.21, 5.1 before 5.1.9, and 5.2 before 5.2.1 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 needing to sign up.

The vulnerability can lead to denial-of-service conditions, causing slow performance and potentially making the application unresponsive.

Yes, implementing input validation to filter out problematic HTML tags can serve as a temporary workaround until you can update to a secure version.

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.21 4.2.21
    pip install --upgrade "django==4.2.21"
  • >= 5.1, < 5.1.9 5.1.9
    pip install --upgrade "django==5.1.9"
  • >= 5.2, < 5.2.1 5.2.1
    pip install --upgrade "django==5.2.1"

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