CVE-2024-41991: Django Django Vulnerable To Denial-of-service Attack Vulnerability

MODERATE
Advisory Identifier: GHSA-r836-hh6v-rg5g
CVSS 5.3
CWE-1333 CWE-1284 CWE-130
Published
Advisory Summary

CVE-2024-41991 is a MODERATE (CVSS 5.3) django vulnerable to denial-of-service attack vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Django libraries in the PyPI ecosystem. The issue involves django vulnerable to denial-of-service attack. Remediation is available by upgrading affected packages to version 5.0.8, 4.2.15.

CVE-2024-41991 at a Glance

CVE Identifier CVE-2024-41991
GHSA Identifier GHSA-r836-hh6v-rg5g
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-41991

To remediate this vulnerability, upgrade all affected Django dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

Django fixed: 5.0.8
pip install Django>=5.0.8
Django fixed: 4.2.15
pip install Django>=4.2.15
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show Django

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2024-41991, inspect your installed packages using pip:

pip show Django

Analyze the terminal output to locate any version of Django in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.8), your application is affected.

Note: The pip show Django command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Django, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An issue was discovered in Django 5.0 before 5.0.8 and 4.2 before 4.2.15. The urlize and urlizetrunc template filters, and the AdminURLFieldWidget widget, are subject to a potential denial-of-service attack via certain inputs with a very large number of Unicode characters.

CVE-2024-41991 Affected Django Versions

2 component(s)
Fixed Versions:
5.0.84.2.15
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 5.0
< 5.0.8
5.0.8
Django
PyPI
≥ 4.2
< 4.2.15
4.2.15

References

Frequently Asked Questions

What is CVE-2024-41991?
CVE-2024-41991 is a security vulnerability in Django involving Django vulnerable to denial-of-service attack under CWE-1333: Inefficient Regular Expression Complexity.
Which Django versions are affected?
Affected versions include releases prior to 5.0.8, 4.2.15 across affected packages: Django.
What version fixes CVE-2024-41991?
Upgrading to 5.0.8, 4.2.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Django affected?
Yes, Django is affected in releases prior to 5.0.8, 4.2.15. Upgrade your dependency to 5.0.8, 4.2.15 or later.
What is the CVSS score of CVE-2024-41991?
CVE-2024-41991 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-41991?
CVE-2024-41991 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check PyPI dependencies for CVE-2024-41991?
Run the dependency tree command: 'pip show Django'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r836-hh6v-rg5g",
  "modified" : "2025-11-04T19:51:04Z",
  "published" : "2024-08-07T15:30:42Z",
  "aliases" : [ "CVE-2024-41991" ],
  "summary" : "Django vulnerable to denial-of-service attack",
  "details" : "An issue was discovered in Django 5.0 before 5.0.8 and 4.2 before 4.2.15. The urlize and urlizetrunc template filters, and the AdminURLFieldWidget widget, are subject to a potential denial-of-service attack via certain inputs with a very large number of Unicode characters.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0"
      }, {
        "fixed" : "5.0.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2"
      }, {
        "fixed" : "4.2.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41991"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/523da8771bce321023f490f70d71a9e973ddc927"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/efea1ef7e2190e3f77ca0651b5458297bc0f6a9f"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/dev/releases/security"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2024-69.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21forum/django-announce"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240905-0007"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2024/aug/06/security-releases"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1284", "CWE-130", "CWE-1333" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-07T19:03:05Z",
    "nvd_published_at" : "2024-08-07T15:15:56Z"
  }
}