# GHSA-x563-6hqv-26mr: Ibis PyArrow dependency allows arbitrary code execution when loading a malicious data file

> Deserialization of untrusted Parquet or IPC files in PyArrow allows arbitrary code execution, affecting Ibis users via Pandas or Dask backends.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 17 Nov 2023

## What is GHSA-x563-6hqv-26mr?

GHSA-x563-6hqv-26mr is an unsafe deserialization vulnerability in ibis-framework, published on 17 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

### Impact

Deserialization of untrusted data in IPC and Parquet readers in PyArrow versions 0.14.0 to 14.0.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 PyArrow, not other Apache Arrow implementations or bindings.

Note that Ibis itself makes **extremely limited** use of `pyarrow.parquet.read_table`:

1. `read_table` is used in tests, where the input file is entirely controlled by the Ibis developers
2. `read_table` is used in the `ibis/examples/__init__.py` as a fallback for backends that don't support reading Parquet directly. Parquet data used in `ibis.examples` are also managed by the Ibis developers. This Parquet data is generated from CSV files and SQLite databases.
3. The Pandas and Dask backends both use PyArrow to read Parquet files and are therefore affected.

Ibis **does not** make use of APIs that directly read from either Arrow IPC files or Feather files.

### Patches

Ibis imports the `pyarrow_hotfix` package wherever pyarrow is used, as of version 7.1.0.

Upgrading to Arrow 14.0.1 is also a possible solution, starting in Ibis 7.1.0.

### Workarounds

Install [`pyarrow_hotfix`](https://pypi.org/project/pyarrow-hotfix/) and run `import pyarrow_hotfix` ahead of any and all `import ibis` statements.

For example:

```python
import ibis
```

becomes

```python
import pyarrow_hotfix
import ibis
```

### References

https://www.cve.org/CVERecord?id=CVE-2023-47248
https://nvd.nist.gov/vuln/detail/CVE-2023-47248

## Which versions are affected by GHSA-x563-6hqv-26mr?

2 open source packages ship an affected version, including ibis-framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ibis-framework` | PyPI | All versions | 7.1.0 |
| `ibis-framework` | PyPI | All versions | 7.1.0 |

## How do I fix GHSA-x563-6hqv-26mr?

Upgrade ibis-framework to 7.1.0 or later.

## Is GHSA-x563-6hqv-26mr being exploited?

There is no known exploitation of GHSA-x563-6hqv-26mr in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-x563-6hqv-26mr and fix it if it is affected.

What it is: GHSA-x563-6hqv-26mr is an unsafe deserialization vulnerability in ibis-framework, published on 17 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-x563-6hqv-26mr in the wild and no public exploit code.

Affected packages and fixed versions:
- ibis-framework (PyPI): affected all versions; fixed in 7.1.0
- ibis-framework (PyPI): affected all versions; fixed in 7.1.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/GHSA-x563-6hqv-26mr/ (Markdown: https://insights.sbomify.com/GHSA-x563-6hqv-26mr/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-x563-6hqv-26mr

---
From sbomify Insights: https://insights.sbomify.com/GHSA-x563-6hqv-26mr/
Summaries are generated and may contain mistakes; the official description above is the record.
