CVE-2024-24565: Crate CrateDB Database Has An Arbitrary Vulnerability

MODERATE
Advisory Identifier: GHSA-475g-vj6c-xf96
CVSS 5.7
CWE-22
Published
Advisory Summary

CVE-2024-24565 is a MODERATE (CVSS 5.7) cratedb database has an arbitrary vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Crate libraries in the Maven ecosystem. The issue involves cratedb database has an arbitrary file read vulnerability. Remediation is available by upgrading affected packages to version 5.3.9, 5.4.8, 5.5.4, 5.6.1.

CVE-2024-24565 at a Glance

CVE Identifier CVE-2024-24565
GHSA Identifier GHSA-475g-vj6c-xf96
Severity MODERATE
CVSS v3.1 Base Score 5.7
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Crate
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.7

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
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-24565

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

io.crate:crate fixed: 5.3.9
<dependency>
    <groupId>io.crate</groupId>
    <artifactId>crate</artifactId>
    <version>5.3.9</version>
</dependency>
io.crate:crate fixed: 5.4.8
<dependency>
    <groupId>io.crate</groupId>
    <artifactId>crate</artifactId>
    <version>5.4.8</version>
</dependency>
io.crate:crate fixed: 5.5.4
<dependency>
    <groupId>io.crate</groupId>
    <artifactId>crate</artifactId>
    <version>5.5.4</version>
</dependency>
io.crate:crate fixed: 5.6.1
<dependency>
    <groupId>io.crate</groupId>
    <artifactId>crate</artifactId>
    <version>5.6.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.crate

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-24565, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.crate

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

Note: The mvn dependency:tree -Dincludes=io.crate command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Crate, 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

### Summary There is an arbitrary file read vulnerability in the CrateDB database, and authenticated CrateDB database users can read any file on the system. ### Details There is a COPY FROM function in the CrateDB database that is used to import file data into database tables. This function has a flaw, and authenticated attackers can use the COPY FROM function to import arbitrary file content into database tables, resulting in information leakage. ### PoC ``` CREATE TABLE info_leak(info_leak STRING); COPY info_leak FROM '/etc/passwd' with (format='csv', header=false); or COPY info_leak FROM '/crate/config/crate.yml' with (format='csv', header=false); SELECT * FROM info_leak; ``` ![image](https://user-images.githubusercontent.com/154296962/292985975-ff5f2fb8-1a3f-4b49-9951-cd1fc6e78031.png) ### Impact This vulnerability affects all current versions of the CrateDB database. Attackers who exploit this vulnerability to obtain sensitive information may carry out further attacks, while also affecting CrateDB Cloud Clusters. ![image](https://user-images.githubusercontent.com/154296962/292986215-aec5adfe-38cc-4f31-bf86-c50ecbb44d5d.png)

CVE-2024-24565 Affected Crate Versions

4 component(s)
Fixed Versions:
5.3.95.4.85.5.45.6.1
Product / Package Ecosystem Affected Versions Fixed Version
io.crate:crate
Maven
< 5.3.9
5.3.9
io.crate:crate
Maven
≥ 5.4.0
< 5.4.8
5.4.8
io.crate:crate
Maven
≥ 5.5.0
< 5.5.4
5.5.4
io.crate:crate
Maven
≥ 5.6.0
< 5.6.1
All 1 versions
5.6.0
5.6.1

References

Frequently Asked Questions

What is CVE-2024-24565?
CVE-2024-24565 is a security vulnerability in Crate involving CrateDB database has an arbitrary file read vulnerability under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Crate versions are affected?
Affected versions include releases prior to 5.3.9, 5.4.8, 5.5.4, 5.6.1 across affected packages: io.crate:crate.
What version fixes CVE-2024-24565?
Upgrading to 5.3.9, 5.4.8, 5.5.4, 5.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is crate affected?
Yes, io.crate:crate is affected in releases prior to 5.3.9, 5.4.8, 5.5.4, 5.6.1. Upgrade your dependency to 5.3.9, 5.4.8, 5.5.4, 5.6.1 or later.
What is the CVSS score of CVE-2024-24565?
CVE-2024-24565 has a CVSS v3.1 base score of 5.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-24565?
CVE-2024-24565 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Maven dependencies for CVE-2024-24565?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.crate'. 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-475g-vj6c-xf96",
  "modified" : "2024-01-30T20:57:16Z",
  "published" : "2024-01-30T20:57:16Z",
  "aliases" : [ "CVE-2024-24565" ],
  "summary" : "CrateDB database has an arbitrary file read vulnerability",
  "details" : "### Summary\nThere is an arbitrary file read vulnerability in the CrateDB database, and authenticated CrateDB database users can read any file on the system.\n\n### Details\nThere is a COPY FROM function in the CrateDB database that is used to import file data into database tables. This function has a flaw, and authenticated attackers can use the COPY FROM function to import arbitrary file content into database tables, resulting in information leakage.\n\n### PoC\n```\nCREATE TABLE info_leak(info_leak STRING);\nCOPY info_leak FROM '/etc/passwd' with (format='csv', header=false); or COPY info_leak FROM '/crate/config/crate.yml' with (format='csv', header=false);\nSELECT * FROM info_leak;\n```\n![image](https://user-images.githubusercontent.com/154296962/292985975-ff5f2fb8-1a3f-4b49-9951-cd1fc6e78031.png)\n\n\n### Impact\nThis vulnerability affects all current versions of the CrateDB database. Attackers who exploit this vulnerability to obtain sensitive information may carry out further attacks, while also affecting CrateDB Cloud Clusters.\n![image](https://user-images.githubusercontent.com/154296962/292986215-aec5adfe-38cc-4f31-bf86-c50ecbb44d5d.png)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.crate:crate"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.3.9"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.crate:crate"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.4.0"
      }, {
        "fixed" : "5.4.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.crate:crate"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.5.0"
      }, {
        "fixed" : "5.5.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.crate:crate"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.6.0"
      }, {
        "fixed" : "5.6.1"
      } ]
    } ],
    "versions" : [ "5.6.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/crate/crate/security/advisories/GHSA-475g-vj6c-xf96"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24565"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crate/crate/commit/32d0fc2ebb834ea324eb7ab5d01320a67bc5c3c7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crate/crate/commit/4e857d675683095945dd524d6ba03e692c70ecd6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crate/crate/commit/b75aeeabf90f51bd96ddb499903928fd10185207"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crate/crate/commit/c4c97d5a1c52cc2250ea42d062a3d37550c19dd5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/crate/crate/commit/c5034323f1b56ca5d04b8ef4c6029eb63a5ba172"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/crate/crate"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-30T20:57:16Z",
    "nvd_published_at" : "2024-01-30T17:15:12Z"
  }
}