CVE-2023-41164: Django Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-7h4p-27mh-hmrw
CVSS 5.3
CWE-400 CWE-1284
Published
Advisory Summary

CVE-2023-41164 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Django libraries in the PyPI ecosystem. The issue involves django denial of service vulnerability in django.utils.encoding.uri_to_iri. Remediation is available by upgrading affected packages to version 3.2.21, 4.1.11, 4.2.5.

CVE-2023-41164 at a Glance

CVE Identifier CVE-2023-41164
GHSA Identifier GHSA-7h4p-27mh-hmrw
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
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-2023-41164

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: 3.2.21
pip install Django>=3.2.21
Django fixed: 4.1.11
pip install Django>=4.1.11
Django fixed: 4.2.5
pip install Django>=4.2.5
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-2023-41164, 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 3.2.21), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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

In Django 3.2 before 3.2.21, 4.1 before 4.1.11, and 4.2 before 4.2.5, django.utils.encoding.uri_to_iri() is subject to a potential DoS (denial of service) attack via certain inputs with a very large number of Unicode characters.

CVE-2023-41164 Affected Django Versions

3 component(s)
Fixed Versions:
3.2.214.1.114.2.5
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 3.2
< 3.2.21
3.2.21
Django
PyPI
≥ 4.1
< 4.1.11
4.1.11
Django
PyPI
≥ 4.2
< 4.2.5
4.2.5

References

NVD — CVE-2023-41164 NVD
https://nvd.nist.gov/vuln/detail/CVE-2023-41164
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/6f030b1149bd8fa4ba90452e77cb3edc095ce54e
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/9c51b4dcfa0cefcb48231f4d71cafa80821f87b9
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/ba00bc5ec6a7eff5e08be438f7b5b0e9574e8ff0
Django Release RELEASE
https://docs.djangoproject.com/en/4.2/releases/security
Django Source Repository REPOSITORY
https://github.com/django/django
Django Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2023-225.yaml
groups.google.com/forum/ WEB
https://groups.google.com/forum/#!forum/django-announce
groups.google.com/forum/ WEB
https://groups.google.com/forum/#%21forum/django-announce
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HJFRPUHDYJHBH3KYHSPGULQM4JN7BMSU
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HJFRPUHDYJHBH3KYHSPGULQM4JN7BMSU
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D
Django Security Information SECURITY
https://security.netapp.com/advisory/ntap-20231214-0002
Django Release RELEASE
https://www.djangoproject.com/weblog/2023/sep/04/security-releases

Frequently Asked Questions

What is CVE-2023-41164?
CVE-2023-41164 is a security vulnerability in Django involving Django Denial of service vulnerability in django.utils.encoding.uri_to_iri under CWE-400: Uncontrolled Resource Consumption.
Which Django versions are affected?
Affected versions include releases prior to 3.2.21, 4.1.11, 4.2.5 across affected packages: Django.
What version fixes CVE-2023-41164?
Upgrading to 3.2.21, 4.1.11, 4.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Django affected?
Yes, Django is affected in releases prior to 3.2.21, 4.1.11, 4.2.5. Upgrade your dependency to 3.2.21, 4.1.11, 4.2.5 or later.
What is the CVSS score of CVE-2023-41164?
CVE-2023-41164 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-2023-41164?
CVE-2023-41164 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check PyPI dependencies for CVE-2023-41164?
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-7h4p-27mh-hmrw",
  "modified" : "2025-11-04T19:43:27Z",
  "published" : "2023-11-03T06:36:29Z",
  "aliases" : [ "CVE-2023-41164" ],
  "summary" : "Django Denial of service vulnerability in django.utils.encoding.uri_to_iri",
  "details" : "In Django 3.2 before 3.2.21, 4.1 before 4.1.11, and 4.2 before 4.2.5, django.utils.encoding.uri_to_iri() is subject to a potential DoS (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" : "3.2"
      }, {
        "fixed" : "3.2.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1"
      }, {
        "fixed" : "4.1.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2"
      }, {
        "fixed" : "4.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41164"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/6f030b1149bd8fa4ba90452e77cb3edc095ce54e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/9c51b4dcfa0cefcb48231f4d71cafa80821f87b9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/ba00bc5ec6a7eff5e08be438f7b5b0e9574e8ff0"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/4.2/releases/security"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2023-225.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!forum/django-announce"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21forum/django-announce"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HJFRPUHDYJHBH3KYHSPGULQM4JN7BMSU"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HJFRPUHDYJHBH3KYHSPGULQM4JN7BMSU"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZQJOMNRMVPCN5WMIZ7YSX5LQ7IR2NY4D"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20231214-0002"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2023/sep/04/security-releases"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1284", "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-03T19:32:41Z",
    "nvd_published_at" : "2023-11-03T05:15:29Z"
  }
}