CVE-2021-45115: Denial-of-service in Django

django Updated 02 Oct 2025

Summary

12/01/2022
Yes i
High
7.5

CVE-2021-45115: Denial-of-service in Django. Affects django across 3 version ranges.

>= 2.2a1, < 2.2.26 >= 3.2a1, < 3.2.11 >= 4.0a1, < 4.0.1

Fixed in 2.2.26, 3.2.11 or 4.0.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-45115 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 popular Python web framework used for developing robust and scalable web applications. It provides a wide range of features and tools to simplify the development process. However, Django versions 2.2 before 2.2.26, 3.2 before 3.2.11, and 4.0 before 4.0.1 are vulnerable to a denial-of-service attack. This vulnerability arises from the UserAttributeSimilarityValidator, which incurs significant overhead when evaluating a submitted password that is artificially large compared to the comparison values. If user registration is unrestricted, this vulnerability can be exploited to launch a denial-of-service attack.

Vulnerability Detail

The vulnerability (CVE-2021-45115) in Django allows an attacker to exploit the UserAttributeSimilarityValidator to cause a denial-of-service condition. By submitting a password that is artificially large, the validator incurs significant overhead during the evaluation process. This vulnerability can be exploited when user registration is unrestricted, providing an avenue for a potential denial-of-service attack. The impact of this vulnerability can be severe, as it can lead to service disruption and unavailability.

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.

  • >= 2.2a1, < 2.2.26 2.2.26
    pip install --upgrade "django==2.2.26"
  • >= 3.2a1, < 3.2.11 3.2.11
    pip install --upgrade "django==3.2.11"
  • >= 4.0a1, < 4.0.1 4.0.1
    pip install --upgrade "django==4.0.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading Django is not immediately feasible, a temporary workaround can be implemented by restricting user registration or implementing rate limiting mechanisms. By limiting the number of registration attempts or the rate at which requests are processed, the impact of a potential denial-of-service attack can be mitigated. However, this workaround may affect the user experience and should only be considered as a temporary solution until the upgrade can be performed.

Conclusion

The vulnerability (CVE-2021-45115) in Django exposes the UserAttributeSimilarityValidator to a denial-of-service attack. Upgrading Django to the patched versions is the recommended solution to mitigate this vulnerability. If immediate upgrade is not possible, implementing temporary workarounds such as user registration restrictions or rate limiting can help mitigate the risk. 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 the development of web applications by providing a high-level API and a set of tools and features.

The vulnerability allows an attacker to launch a denial-of-service attack, leading to service disruption and unavailability.

To fix this vulnerability, upgrade Django to version 2.2.26, 3.2.11, or 4.0.1. Thoroughly test the application after the upgrade.

A temporary workaround is to restrict user registration or implement rate limiting mechanisms to mitigate the impact of a potential attack.

Upgrading Django is the recommended solution. However, if immediate upgrade is not feasible, implementing rate limiting mechanisms can provide temporary mitigation.

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.

  • >= 2.2a1, < 2.2.26 2.2.26
    pip install --upgrade "django==2.2.26"
  • >= 3.2a1, < 3.2.11 3.2.11
    pip install --upgrade "django==3.2.11"
  • >= 4.0a1, < 4.0.1 4.0.1
    pip install --upgrade "django==4.0.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