CVE-2023-24580: Django Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-2hrw-hx67-34x6
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2023-24580 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Django libraries in the PyPI ecosystem. The issue involves resource exhaustion in django. Remediation is available by upgrading affected packages to version 3.2.18, 4.1.7, 4.0.10.

CVE-2023-24580 at a Glance

CVE Identifier CVE-2023-24580
GHSA Identifier GHSA-2hrw-hx67-34x6
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:H).

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 High (A:H)

How to Fix CVE-2023-24580

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.18
pip install Django>=3.2.18
Django fixed: 4.1.7
pip install Django>=4.1.7
Django fixed: 4.0.10
pip install Django>=4.0.10
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-24580, 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.18), 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

An issue was discovered in the Multipart Request Parser in Django 3.2 before 3.2.18, 4.0 before 4.0.10, and 4.1 before 4.1.7. Passing certain inputs (e.g., an excessive number of parts) to multipart forms could result in too many open files or memory exhaustion, and provided a potential vector for a denial-of-service attack.

CVE-2023-24580 Affected Django Versions

3 component(s)
Fixed Versions:
3.2.184.1.74.0.10
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 3.2a1
< 3.2.18
3.2.18
Django
PyPI
≥ 4.1a1
< 4.1.7
4.1.7
Django
PyPI
≥ 4.0a1
< 4.0.10
4.0.10

References

NVD — CVE-2023-24580 NVD
https://nvd.nist.gov/vuln/detail/CVE-2023-24580
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/628b33a854a9c68ec8a0c51f382f304a0044ec92
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/83f1ea83e4553e211c1c5a0dfc197b66d4e50432
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/a665ed5179f5bbd3db95ce67286d0192eff041d8
Django Release RELEASE
https://www.djangoproject.com/weblog/2023/feb/14/security-releases
Django Security Information SECURITY
https://security.netapp.com/advisory/ntap-20230316-0006
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YJB6FUBBLVKKG655UMTLQNN6UQ6EDLSP
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VZS4G6NSZWPTVXMMZHJOJVQEPL3QTO77
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FKYVMMR7RPM6AHJ2SBVM2LO6D3NGFY7B
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YJB6FUBBLVKKG655UMTLQNN6UQ6EDLSP
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VZS4G6NSZWPTVXMMZHJOJVQEPL3QTO77
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FKYVMMR7RPM6AHJ2SBVM2LO6D3NGFY7B
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2023/02/msg00023.html
groups.google.com/forum/ WEB
https://groups.google.com/forum/#%21forum/django-announce
groups.google.com/forum/ WEB
https://groups.google.com/forum/#!forum/django-announce
Django Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2023-13.yaml
Django Source Repository REPOSITORY
https://github.com/django/django
Django Release RELEASE
https://docs.djangoproject.com/en/4.1/releases/security
Django Security Information SECURITY
http://www.openwall.com/lists/oss-security/2023/02/14/1

Frequently Asked Questions

What is CVE-2023-24580?
CVE-2023-24580 is a security vulnerability in Django involving Resource exhaustion in Django under CWE-400: Uncontrolled Resource Consumption.
Which Django versions are affected?
Affected versions include releases prior to 3.2.18, 4.1.7, 4.0.10 across affected packages: Django.
What version fixes CVE-2023-24580?
Upgrading to 3.2.18, 4.1.7, 4.0.10 (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.18, 4.1.7, 4.0.10. Upgrade your dependency to 3.2.18, 4.1.7, 4.0.10 or later.
What is the CVSS score of CVE-2023-24580?
CVE-2023-24580 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-24580?
CVE-2023-24580 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-24580?
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-2hrw-hx67-34x6",
  "modified" : "2025-03-19T15:39:39Z",
  "published" : "2023-02-15T03:30:47Z",
  "aliases" : [ "CVE-2023-24580" ],
  "summary" : "Resource exhaustion in Django",
  "details" : "An issue was discovered in the Multipart Request Parser in Django 3.2 before 3.2.18, 4.0 before 4.0.10, and 4.1 before 4.1.7. Passing certain inputs (e.g., an excessive number of parts) to multipart forms could result in too many open files or memory exhaustion, and provided a potential vector for a denial-of-service attack.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.2a1"
      }, {
        "fixed" : "3.2.18"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1a1"
      }, {
        "fixed" : "4.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0a1"
      }, {
        "fixed" : "4.0.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-24580"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/628b33a854a9c68ec8a0c51f382f304a0044ec92"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/83f1ea83e4553e211c1c5a0dfc197b66d4e50432"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/a665ed5179f5bbd3db95ce67286d0192eff041d8"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2023/feb/14/security-releases"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20230316-0006"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YJB6FUBBLVKKG655UMTLQNN6UQ6EDLSP"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VZS4G6NSZWPTVXMMZHJOJVQEPL3QTO77"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FKYVMMR7RPM6AHJ2SBVM2LO6D3NGFY7B"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YJB6FUBBLVKKG655UMTLQNN6UQ6EDLSP"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VZS4G6NSZWPTVXMMZHJOJVQEPL3QTO77"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FKYVMMR7RPM6AHJ2SBVM2LO6D3NGFY7B"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2023/02/msg00023.html"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21forum/django-announce"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!forum/django-announce"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2023-13.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/4.1/releases/security"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2023/02/14/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-15T17:42:14Z",
    "nvd_published_at" : "2023-02-15T01:15:00Z"
  }
}