CVE-2022-41323: Django Django Denial-of-service Vulnerability Vulnerability

HIGH
Advisory Identifier: GHSA-qrw5-5h28-6cmg
CVSS 7.5
CWE-1333
Published
Advisory Summary

CVE-2022-41323 is a HIGH (CVSS 7.5) django denial-of-service vulnerability vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Django libraries in the PyPI ecosystem. The issue involves django denial-of-service vulnerability in internationalized urls. Remediation is available by upgrading affected packages to version 3.2.16, 4.0.8, 4.1.2.

CVE-2022-41323 at a Glance

CVE Identifier CVE-2022-41323
GHSA Identifier GHSA-qrw5-5h28-6cmg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
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-2022-41323

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.16
pip install Django>=3.2.16
Django fixed: 4.0.8
pip install Django>=4.0.8
Django fixed: 4.1.2
pip install Django>=4.1.2
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-2022-41323, 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.16), 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

In Django 3.2 before 3.2.16, 4.0 before 4.0.8, and 4.1 before 4.1.2, internationalized URLs were subject to a potential denial of service attack via the locale parameter, which is treated as a regular expression.

CVE-2022-41323 Affected Django Versions

3 component(s)
Fixed Versions:
3.2.164.0.84.1.2
Product / Package Ecosystem Affected Versions Fixed Version
Django
PyPI
≥ 3.2
< 3.2.16
3.2.16
Django
PyPI
≥ 4.0
< 4.0.8
4.0.8
Django
PyPI
≥ 4.1
< 4.1.2
4.1.2

References

NVD — CVE-2022-41323 NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-41323
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/23f0093125ac2e553da6c1b2f9988eb6a3dd2ea1
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/5b6b257fa7ec37ff27965358800c67e2dd11c924
Security Fix Commit FIX COMMIT
https://github.com/django/django/commit/9d656ea51d9ea7105c0c0785783ac29d426a7d25
Django Release RELEASE
https://docs.djangoproject.com/en/4.0/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-2022-304.yaml
groups.google.com/forum/ WEB
https://groups.google.com/forum/#!forum/django-announce
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@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK
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/VZS4G6NSZWPTVXMMZHJOJVQEPL3QTO77
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YJB6FUBBLVKKG655UMTLQNN6UQ6EDLSP
Django Security Information SECURITY
https://security.netapp.com/advisory/ntap-20221124-0001
Django Release RELEASE
https://www.djangoproject.com/weblog/2022/oct/04/security-releases

Frequently Asked Questions

What is CVE-2022-41323?
CVE-2022-41323 is a security vulnerability in Django involving Django denial-of-service vulnerability in internationalized URLs under CWE-1333: Inefficient Regular Expression Complexity.
Which Django versions are affected?
Affected versions include releases prior to 3.2.16, 4.0.8, 4.1.2 across affected packages: Django.
What version fixes CVE-2022-41323?
Upgrading to 3.2.16, 4.0.8, 4.1.2 (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.16, 4.0.8, 4.1.2. Upgrade your dependency to 3.2.16, 4.0.8, 4.1.2 or later.
What is the CVSS score of CVE-2022-41323?
CVE-2022-41323 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-2022-41323?
CVE-2022-41323 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-2022-41323?
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-qrw5-5h28-6cmg",
  "modified" : "2024-09-20T15:34:48Z",
  "published" : "2022-10-16T12:00:23Z",
  "aliases" : [ "CVE-2022-41323" ],
  "summary" : "Django denial-of-service vulnerability in internationalized URLs",
  "details" : "In Django 3.2 before 3.2.16, 4.0 before 4.0.8, and 4.1 before 4.1.2, internationalized URLs were subject to a potential denial of service attack via the locale parameter, which is treated as a regular expression. ",
  "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.2"
      }, {
        "fixed" : "3.2.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0"
      }, {
        "fixed" : "4.0.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Django"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1"
      }, {
        "fixed" : "4.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41323"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/23f0093125ac2e553da6c1b2f9988eb6a3dd2ea1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/5b6b257fa7ec37ff27965358800c67e2dd11c924"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/django/django/commit/9d656ea51d9ea7105c0c0785783ac29d426a7d25"
  }, {
    "type" : "WEB",
    "url" : "https://docs.djangoproject.com/en/4.0/releases/security"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/django/django"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-304.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!forum/django-announce"
  }, {
    "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@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK"
  }, {
    "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/VZS4G6NSZWPTVXMMZHJOJVQEPL3QTO77"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YJB6FUBBLVKKG655UMTLQNN6UQ6EDLSP"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20221124-0001"
  }, {
    "type" : "WEB",
    "url" : "https://www.djangoproject.com/weblog/2022/oct/04/security-releases"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-18T17:10:24Z",
    "nvd_published_at" : "2022-10-16T06:15:00Z"
  }
}