# CVE-2024-52338: Apache Arrow R package: Arbitrary code execution when loading a malicious data file

> Attackers can execute arbitrary code by tricking users into loading malicious Arrow IPC or Parquet files in the Apache Arrow R package.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Nov 2024
- **Updated:** 29 Nov 2024
- **Also known as:** AZL-53423, AZL-53471, GHSA-m5xw-hwxw-fq3j, JLSEC-2026-804, PYSEC-2024-161

## What is CVE-2024-52338?

CVE-2024-52338 is a critical unsafe deserialization vulnerability in Apache Arrow R package, published on 28 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Deserialization of untrusted data in IPC and Parquet readers in the Apache Arrow R package versions 4.0.0 through 16.1.0 allows arbitrary code execution. An application is vulnerable if it 
reads Arrow IPC, Feather or Parquet data from untrusted sources (for 
example, user-supplied input files). This vulnerability only affects the arrow R package, not other Apache Arrow 
implementations or bindings unless those bindings are specifically used via the R package (for example, an R application that embeds a Python interpreter and uses PyArrow to read files from untrusted sources is still vulnerable if the arrow R package is an affected version). It is recommended that users of the arrow R package upgrade to 17.0.0 or later. Similarly, it
 is recommended that downstream libraries upgrade their dependency 
requirements to arrow 17.0.0 or later. If using an affected
version of the package, untrusted data can read into a Table and its internal to_data_frame() method can be used as a workaround (e.g., read_parquet(..., as_data_frame = FALSE)$to_data_frame()).

This issue affects the Apache Arrow R package: from 4.0.0 through 16.1.0.

Users are recommended to upgrade to version 17.0.0, which fixes the issue.

Weakness: CWE-502 (Deserialization of Untrusted Data)

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

1 open source package ship an affected version, including pyarrow. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pyarrow` | PyPI | From 4.0.0 | 17.0.0 |

Products: Apache Arrow.

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

Upgrade pyarrow to 17.0.0 or later.

## Is CVE-2024-52338 being exploited?

There is no known exploitation of CVE-2024-52338 in the wild and no public exploit code.

## Other vulnerabilities in Apache Arrow R package

- [CVE-2024-41178](https://insights.sbomify.com/CVE-2024-41178/): Apache Arrow Rust Object Store: AWS WebIdentityToken exposure in log files (high 7.5)
- [CVE-2019-12408](https://insights.sbomify.com/CVE-2019-12408/): Missing Initialization of Resource in Apache Arrow (high 7.5)
- [CVE-2019-12410](https://insights.sbomify.com/CVE-2019-12410/): Missing Initialization of Resource in Apache Arrow (high 7.5)
- [CVE-2026-25087](https://insights.sbomify.com/CVE-2026-25087/): Apache Arrow: Potential use-after-free when reading IPC file with pre-buffering (high 7.0)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-52338 is a critical unsafe deserialization vulnerability in Apache Arrow R package, published on 28 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-52338 in the wild and no public exploit code.

Affected packages and fixed versions:
- pyarrow (PyPI): affected from 4.0.0; fixed in 17.0.0

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-52338/ (Markdown: https://insights.sbomify.com/CVE-2024-52338/index.md)
```

## Sources

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

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