CVE-2023-32321: Ckan Remote Code Execution Vulnerability
CRITICALCVE-2023-32321 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-20: Improper Input Validation) affecting Ckan libraries in the PyPI ecosystem. The issue involves ckan remote code execution and private information access via crafted resource ids. Remediation is available by upgrading affected packages to version 2.9.9.
CVE-2023-32321 at a Glance
Security Impact
CVSS: 9.8
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:H/I:H/A:H).
How to Fix CVE-2023-32321
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.
pip install ckan>=2.9.9
pip install ckan>=Latest secure release
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-32321, 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.9), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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
CVE-2023-32321 Affected Ckan Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2023-32321?
Which Ckan versions are affected?
What version fixes CVE-2023-32321?
Is ckan affected?
What is the CVSS score of CVE-2023-32321?
What CWE is associated with CVE-2023-32321?
How can I check PyPI dependencies for CVE-2023-32321?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-446m-hmmm-hm8m",
"modified" : "2023-05-29T16:12:22Z",
"published" : "2023-05-24T17:24:56Z",
"aliases" : [ "CVE-2023-32321" ],
"summary" : "Ckan remote code execution and private information access via crafted resource ids",
"details" : "Specific vulnerabilities:\n\n* Arbitrary file write in `resource_create` and `package_update` actions, using the `ResourceUploader` object. Also reachable via `package_create`, `package_revise`, and `package_patch` via calls to `package_update`.\n* Remote code execution via unsafe pickle loading, via Beaker's session store when configured to use the file session store backend.\n* Potential DOS due to lack of a length check on the resource id.\n* Information disclosure: A user with permission to create a resource can access any other resource on the system if they know the id, even if they don't have access to it.\n* Resource overwrite: A user with permission to create a resource can overwrite any resource if they know the id, even if they don't have access to it. \n\n### Impact\n\nA user with permissions to create or edit a dataset can upload a resource with a specially crafted id to write the uploaded file in an arbitrary location. This can be leveraged to Remote Code Execution via Beaker's insecure pickle loading. \n\n### Patches\n\nAll the above listed vulnerabilities have been fixed in CKAN 2.9.9 and CKAN 2.10.1\nThe patches for CKAN 2.9 should apply easily to previous CKAN versions.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ckan"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.9.9"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ckan"
},
"versions" : [ "2.10.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ckan/ckan/security/advisories/GHSA-446m-hmmm-hm8m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-32321"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ckan/ckan"
}, {
"type" : "WEB",
"url" : "https://github.com/ckan/ckan/blob/2a6080e61d5601fa0e2a0317afd6a8e9b7abf6dd/CHANGELOG.rst"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2023-05-24T17:24:56Z",
"nvd_published_at" : "2023-05-26T23:15:18Z"
}
}