# CVE-2024-14021: LlamaIndex <= 0.11.6 BGEM3Index Unsafe Deserialization

> Attackers can execute arbitrary code by providing a malicious pickle file to LlamaIndex's BGEM3Index loader.

- **Severity:** High 8.4 (`CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 12 Jan 2026
- **Updated:** 28 Jul 2026
- **Also known as:** GHSA-m592-cr2f-4qg5, PYSEC-2026-85

## What is CVE-2024-14021?

CVE-2024-14021 is a high-severity unsafe deserialization vulnerability in run-llama llama_index, published on 12 Jan 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

LlamaIndex (run-llama/llama_index) versions up to and including 0.11.6 contain an unsafe deserialization vulnerability in BGEM3Index.load_from_disk() in llama_index/indices/managed/bge_m3/base.py. The function uses pickle.load() to deserialize multi_embed_store.pkl from a user-supplied persist_dir without validation. An attacker who can provide a crafted persist directory containing a malicious pickle file can trigger arbitrary code execution when the victim loads the index from disk.

Weakness: CWE-502 (Deserialization of Untrusted Data)

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

1 open source package ship an affected version, including llama-index. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `llama-index` | PyPI | All versions | 0.11.7 |

Products: Llamaindex Llamaindex.

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

Upgrade llama-index to 0.11.7 or later.

## Is CVE-2024-14021 being exploited?

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

## Other vulnerabilities in run-llama llama_index

- [CVE-2024-12909](https://insights.sbomify.com/CVE-2024-12909/): SQL Injection to RCE in run-llama/llama_index (critical 10.0)
- [CVE-2025-1793](https://insights.sbomify.com/CVE-2025-1793/): SQL Injection in run-llama/llama_index (critical 9.8)
- [CVE-2025-1750](https://insights.sbomify.com/CVE-2025-1750/): SQL Injection in run-llama/llama_index (critical 9.8)
- [CVE-2024-11958](https://insights.sbomify.com/CVE-2024-11958/): SQL Injection in run-llama/llama_index (critical 9.8)
- [CVE-2024-3271](https://insights.sbomify.com/CVE-2024-3271/): Command Injection in run-llama/llama_index (critical 9.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-14021 is a high-severity unsafe deserialization vulnerability in run-llama llama_index, published on 12 Jan 2026. It can only be exploited from the same machine or local 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-14021 exists.

Affected packages and fixed versions:
- llama-index (PyPI): affected all versions; fixed in 0.11.7

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

## Sources

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

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