# CVE-2024-24565: CrateDB database has an arbitrary file read vulnerability

> Authenticated attackers can exploit the COPY FROM function to read arbitrary files from the server, leading to information leakage.

- **Severity:** Medium 5.7 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 30 Jan 2024
- **Updated:** 23 Aug 2024
- **Also known as:** GHSA-475g-vj6c-xf96

## What is CVE-2024-24565?

CVE-2024-24565 is a medium-severity path traversal vulnerability in crate, published on 30 Jan 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

CrateDB is a distributed SQL database that makes it simple to store and analyze massive amounts of data in real-time. 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. This vulnerability is patched in 5.3.9, 5.4.8, 5.5.4, and 5.6.1.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-24565?

8 open source packages ship an affected version, including io.crate:crate. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.crate:crate` | Maven | All versions | 5.3.9 |
| `io.crate:crate` | Maven | All versions | 5.3.9 |
| `io.crate:crate` | Maven | From 5.4.0 | 5.4.8 |
| `io.crate:crate` | Maven | From 5.4.0 | 5.4.8 |
| `io.crate:crate` | Maven | From 5.5.0 | 5.5.4 |
| `io.crate:crate` | Maven | From 5.5.0 | 5.5.4 |
| `io.crate:crate` | Maven | From 5.6.0 | 5.6.1 |
| `io.crate:crate` | Maven | From 5.6.0 | 5.6.1 |

Products: Cratedb Cratedb.

## How do I fix CVE-2024-24565?

Upgrade io.crate:crate to a fixed version for your release line: 5.3.9, 5.4.8, 5.5.4 or 5.6.1.

## Is CVE-2024-24565 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24565 exists.

Public exploit code:

- CrateDB Database - Arbitrary File Read (nuclei): http/cves/2024/CVE-2024-24565.yaml

## Other vulnerabilities in crate

- [CVE-2023-51982](https://insights.sbomify.com/CVE-2023-51982/): CrateDB authentication bypass vulnerability (critical 9.8)
- [CVE-2024-37309](https://insights.sbomify.com/CVE-2024-37309/): Client initialized Session-Renegotiation DoS (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-24565 and fix it if it is affected.

What it is: CVE-2024-24565 is a medium-severity path traversal vulnerability in crate, published on 30 Jan 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-24565 exists.

Affected packages and fixed versions:
- io.crate:crate (Maven): affected all versions; fixed in 5.3.9
- io.crate:crate (Maven): affected all versions; fixed in 5.3.9
- io.crate:crate (Maven): affected from 5.4.0; fixed in 5.4.8
- io.crate:crate (Maven): affected from 5.4.0; fixed in 5.4.8
- io.crate:crate (Maven): affected from 5.5.0; fixed in 5.5.4
- io.crate:crate (Maven): affected from 5.5.0; fixed in 5.5.4
- io.crate:crate (Maven): affected from 5.6.0; fixed in 5.6.1
- io.crate:crate (Maven): affected from 5.6.0; fixed in 5.6.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-24565/ (Markdown: https://insights.sbomify.com/CVE-2024-24565/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-24565
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-24565
- OSV: https://osv.dev/vulnerability/CVE-2024-24565

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-24565/
Summaries are generated and may contain mistakes; the official description above is the record.
