CVE-2024-43371: Ckan Potential Access To Sensitive URLs Vulnerability

MODERATE
Advisory Identifier: GHSA-g9ph-j5vj-f8wm
CVSS 4.5
CWE-918
Published
Advisory Summary

CVE-2024-43371 is a MODERATE (CVSS 4.5) potential access to sensitive urls vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Ckan libraries in the PyPI ecosystem. The issue involves potential access to sensitive urls via ckan extensions (ssrf). Remediation is available by upgrading affected packages to version 2.10.5.

CVE-2024-43371 at a Glance

CVE Identifier CVE-2024-43371
GHSA Identifier GHSA-g9ph-j5vj-f8wm
Severity MODERATE
CVSS v3.1 Base Score 4.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
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:H/I:N/A:N).

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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-43371

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.10.5
pip install ckan>=2.10.5
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-2024-43371, 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.10.5), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. 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 There are a number of CKAN plugins, including [XLoader](https://github.com/ckan/ckanext-xloader), [DataPusher](https://github.com/ckan/datapusher), [Resource proxy](https://docs.ckan.org/en/latest/maintaining/data-viewer.html#resource-proxy) and [ckanext-archiver](https://github.com/ckan/ckanext-archiver/), that work by downloading the contents of local or remote files in order to perform some actions with their contents (e.g. pushing to the DataStore, streaming contents or saving a local copy). All of them use the resource URL, and there are currently no checks to limit what URLs can be requested. This means that a malicious (or unaware) user can create a resource with a URL pointing to a place where they should not have access in order for one of the previous tools to retrieve it (known as a [Server Side Request Forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery)). ### Patches and Workarounds Users wanting to protect against these kinds of attacks can use one or a combination of the following approaches: * Use a separate HTTP proxy like [Squid](https://www.squid-cache.org/) that can be used to allow / disallow IPs, domains etc as needed, and make CKAN extensions aware of this setting via the [`ckan.download_proxy`](https://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-download-proxy) config option. * Implement custom firewall rules to prevent access to restricted resources. * Use custom validators on the resource `url` field to block/allow certain domains or IPs. All latest versions of the plugins linked above support the `ckan.download_proxy` settings. Support for this setting in the Resource Proxy plugin was included in CKAN 2.10.5 and 2.11.0 ### References * [Blog post](https://feeding.cloud.geek.nz/posts/restricting-outgoing-webapp-requests-using-squid-proxy/) provides more details on how to configure a Squid proxy to prevent these issues

CVE-2024-43371 Affected Ckan Versions

1 component(s)
Fixed Versions:
2.10.5
Product / Package Ecosystem Affected Versions Fixed Version
ckan
PyPI
< 2.10.5
2.10.5

References

Frequently Asked Questions

What is CVE-2024-43371?
CVE-2024-43371 is a security vulnerability in Ckan involving Potential access to sensitive URLs via CKAN extensions (SSRF) under CWE-918: Server-Side Request Forgery (SSRF).
Which Ckan versions are affected?
Affected versions include releases prior to 2.10.5 across affected packages: ckan.
What version fixes CVE-2024-43371?
Upgrading to 2.10.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ckan affected?
Yes, ckan is affected in releases prior to 2.10.5. Upgrade your dependency to 2.10.5 or later.
What is the CVSS score of CVE-2024-43371?
CVE-2024-43371 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:H/I:N/A:N.
What CWE is associated with CVE-2024-43371?
CVE-2024-43371 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check PyPI dependencies for CVE-2024-43371?
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-g9ph-j5vj-f8wm",
  "modified" : "2024-08-21T18:27:12Z",
  "published" : "2024-08-21T18:27:11Z",
  "aliases" : [ "CVE-2024-43371" ],
  "summary" : "Potential access to sensitive URLs via CKAN extensions (SSRF)",
  "details" : "### Impact\n\nThere are a number of CKAN plugins, including [XLoader](https://github.com/ckan/ckanext-xloader), [DataPusher](https://github.com/ckan/datapusher), [Resource proxy](https://docs.ckan.org/en/latest/maintaining/data-viewer.html#resource-proxy) and [ckanext-archiver](https://github.com/ckan/ckanext-archiver/), that work by downloading the contents of local or remote files in order to perform some actions with their contents (e.g. pushing to the DataStore, streaming contents or saving a local copy). All of them use the resource URL, and there are currently no checks to limit what URLs can be requested. This means that a malicious (or unaware) user can create a resource with a URL pointing to a place where they should not have access in order for one of the previous tools to retrieve it (known as a [Server Side Request Forgery](https://owasp.org/www-community/attacks/Server_Side_Request_Forgery)).\n\n### Patches and Workarounds\n\nUsers wanting to protect against these kinds of attacks can use one or a combination of the following approaches:\n\n* Use a separate HTTP proxy like [Squid](https://www.squid-cache.org/) that can be used to allow / disallow IPs, domains etc as needed, and make CKAN extensions aware of this setting via the [`ckan.download_proxy`](https://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-download-proxy) config option. \n* Implement custom firewall rules to prevent access to restricted resources.\n* Use custom validators on the resource `url` field to block/allow certain domains or IPs.\n\nAll latest versions of the plugins linked above support the `ckan.download_proxy` settings. Support for this setting in the Resource Proxy plugin was included in CKAN 2.10.5 and 2.11.0\n\n### References\n\n* [Blog post](https://feeding.cloud.geek.nz/posts/restricting-outgoing-webapp-requests-using-squid-proxy/) provides more details on how to configure a Squid proxy to prevent these issues\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ckan"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.10.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ckan/ckan/security/advisories/GHSA-g9ph-j5vj-f8wm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-43371"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ckan/ckan/commit/382beaec98cb331f2a030459ef043c50eaf5ad53"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ckan/ckan/commit/8601183cc2fc87277ea5b33ff75c3a5610812ab5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ckan/ckan"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-21T18:27:11Z",
    "nvd_published_at" : "2024-08-21T15:15:09Z"
  }
}