CVE-2023-50248: Ckan Out Of Memory Error When Vulnerability

MODERATE
Advisory Identifier: GHSA-7fgc-89cx-w8j5
CVSS 4.5
CWE-130
Published
Advisory Summary

CVE-2023-50248 is a MODERATE (CVSS 4.5) out of memory error when vulnerability (CWE-130: Improper Handling of Length Parameter Inconsistency) affecting Ckan libraries in the PyPI ecosystem. The issue involves out of memory error when submitting the dataset form with a specially-crafted field. Remediation is available by upgrading affected packages to version 2.9.10, 2.10.3.

CVE-2023-50248 at a Glance

CVE Identifier CVE-2023-50248
GHSA Identifier GHSA-7fgc-89cx-w8j5
Severity MODERATE
CVSS v3.1 Base Score 4.5
CWE Classification CWE-130: Improper Handling of Length Parameter Inconsistency
Affected Product Ckan
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.5

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

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

How to Fix CVE-2023-50248

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

ckan fixed: 2.9.10
pip install ckan>=2.9.10
ckan fixed: 2.10.3
pip install ckan>=2.10.3
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 ckan

How to Check if You Are Affected

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

pip show ckan

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-130: Improper Handling of Length Parameter Inconsistency, where the product parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data. In Ckan, 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

### Impact When submitting a POST request to the `/dataset/new` endpoint (including either the auth cookie or the `Authorization` header) with a specially-crafted field, an attacker can create an out-of-memory error in the hosting server. To trigger this error the user needs to have permissions to create or edit datasets. ### Patches This vulnerability has been patched in CKAN 2.10.3 and 2.9.10

CVE-2023-50248 Affected Ckan Versions

2 component(s)
Fixed Versions:
2.9.102.10.3
Product / Package Ecosystem Affected Versions Fixed Version
ckan
PyPI
≥ 2.0
< 2.9.10
2.9.10
ckan
PyPI
≥ 2.10.0
< 2.10.3
2.10.3

References

Frequently Asked Questions

What is CVE-2023-50248?
CVE-2023-50248 is a security vulnerability in Ckan involving Out of memory error when submitting the dataset form with a specially-crafted field under CWE-130: Improper Handling of Length Parameter Inconsistency.
Which Ckan versions are affected?
Affected versions include releases prior to 2.9.10, 2.10.3 across affected packages: ckan.
What version fixes CVE-2023-50248?
Upgrading to 2.9.10, 2.10.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ckan affected?
Yes, ckan is affected in releases prior to 2.9.10, 2.10.3. Upgrade your dependency to 2.9.10, 2.10.3 or later.
What is the CVSS score of CVE-2023-50248?
CVE-2023-50248 has a CVSS v3.1 base score of 4.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-50248?
CVE-2023-50248 is classified under CWE-130: Improper Handling of Length Parameter Inconsistency (The product parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.).
How can I check PyPI dependencies for CVE-2023-50248?
Run the dependency tree command: 'pip show ckan'. 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-7fgc-89cx-w8j5",
  "modified" : "2023-12-13T23:08:35Z",
  "published" : "2023-12-13T23:08:35Z",
  "aliases" : [ "CVE-2023-50248" ],
  "summary" : "Out of memory error when submitting the dataset form with a specially-crafted field",
  "details" : "### Impact\n\nWhen submitting a POST request to the `/dataset/new` endpoint (including either the auth cookie or the `Authorization` header) with a specially-crafted field, an attacker can create an out-of-memory error in the hosting server.\n\nTo trigger this error the user needs to have permissions to create or edit datasets.\n\n### Patches\n\nThis vulnerability has been patched in CKAN 2.10.3 and 2.9.10",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ckan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0"
      }, {
        "fixed" : "2.9.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ckan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.10.0"
      }, {
        "fixed" : "2.10.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ckan/ckan/security/advisories/GHSA-7fgc-89cx-w8j5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-50248"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ckan/ckan/commit/bd02018b65c5b81d7ede195d00d0fcbac3aa33be"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ckan/ckan"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-130" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-12-13T23:08:35Z",
    "nvd_published_at" : "2023-12-13T21:15:08Z"
  }
}