CVE-2024-45231: Django Django Allows Enumeration Of User Vulnerability

MODERATE
Advisory Identifier: GHSA-rrqc-c2jx-6jgv
CVSS 3.7
CWE-204 CWE-203
Published
Advisory Summary

CVE-2024-45231 is a MODERATE (CVSS 3.7) django allows enumeration of user vulnerability (CWE-204: Observable Response Discrepancy) affecting Django libraries in the PyPI ecosystem. The issue involves django allows enumeration of user e-mail addresses. Remediation is available by upgrading affected packages to version 5.1.1, 5.0.9, 4.2.16.

CVE-2024-45231 at a Glance

CVE Identifier CVE-2024-45231
GHSA Identifier GHSA-rrqc-c2jx-6jgv
Severity MODERATE
CVSS v3.1 Base Score 3.7
CWE Classification CWE-204: Observable Response Discrepancy
Affected Product Django
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2024-45231

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.1.1
pip install Django>=5.1.1
Django fixed: 5.0.9
pip install Django>=5.0.9
Django fixed: 4.2.16
pip install Django>=4.2.16
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-45231, 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.1.1), 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-204: Observable Response Discrepancy, where the product provides different responses to incoming requests in a way that reveals internal state information to an unauthorized actor outside of the intended control sphere. 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 v5.1.1, v5.0.9, and v4.2.16. The django.contrib.auth.forms.PasswordResetForm class, when used in a view implementing password reset flows, allows remote attackers to enumerate user e-mail addresses by sending password reset requests and observing the outcome (only when e-mail sending is consistently failing).

CVE-2024-45231 Affected Django Versions

3 component(s)
Fixed Versions:
5.1.15.0.94.2.16
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 5.1
< 5.1.1
5.1.1
Django
PyPI
≥ 5.0
< 5.0.9
5.0.9
Django
PyPI
< 4.2.16
4.2.16

References

Frequently Asked Questions

What is CVE-2024-45231?
CVE-2024-45231 is a security vulnerability in Django involving Django allows enumeration of user e-mail addresses under CWE-204: Observable Response Discrepancy.
Which Django versions are affected?
Affected versions include releases prior to 5.1.1, 5.0.9, 4.2.16 across affected packages: Django.
What version fixes CVE-2024-45231?
Upgrading to 5.1.1, 5.0.9, 4.2.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Django affected?
Yes, Django is affected in releases prior to 5.1.1, 5.0.9, 4.2.16. Upgrade your dependency to 5.1.1, 5.0.9, 4.2.16 or later.
What is the CVSS score of CVE-2024-45231?
CVE-2024-45231 has a CVSS v3.1 base score of 3.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-45231?
CVE-2024-45231 is classified under CWE-204: Observable Response Discrepancy (The product provides different responses to incoming requests in a way that reveals internal state information to an unauthorized actor outside of the intended control sphere.).
How can I check PyPI dependencies for CVE-2024-45231?
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-rrqc-c2jx-6jgv",
  "modified" : "2024-10-30T19:02:43Z",
  "published" : "2024-10-08T18:33:13Z",
  "aliases" : [ "CVE-2024-45231" ],
  "summary" : "Django allows enumeration of user e-mail addresses",
  "details" : "An issue was discovered in Django v5.1.1, v5.0.9, and v4.2.16. The django.contrib.auth.forms.PasswordResetForm class, when used in a view implementing password reset flows, allows remote attackers to enumerate user e-mail addresses by sending password reset requests and observing the outcome (only when e-mail sending is consistently failing).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1"
      }, {
        "fixed" : "5.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0"
      }, {
        "fixed" : "5.0.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45231"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/3c733c78d6f8e50296d6e248968b6516c92a53ca"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/96d84047715ea1715b4bd1594e46122b8a77b9e2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/bf4888d317ba4506d091eeac6e8b4f1fcc731199"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/dev/releases/security"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#%21forum/django-announce"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2024/sep/03/security-releases"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203", "CWE-204" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-08T21:17:00Z",
    "nvd_published_at" : "2024-10-08T16:15:11Z"
  }
}