CVE-2025-3108: LlamaIndex has Incomplete Documentation of Program Execution related to JsonPickleSerializer component
LlamaIndex's JsonPickleSerializer, used to restore workflow Context state, tries pickle.loads() first, so deserializing untrusted data runs attacker code. The fix in llama-index-core 0.12.41 renames the class to PickleSerializer and adds a docs warning. It does not change the runtime behavior. Treat all serialized context as trusted-only.
Published Jul 7, 2025 · Analysis Nov 1, 2026
What an attacker can do
The class is in llama_index/core/workflow/context_serializers.py. Its deserialize method tries pickle first and falls back to JSON. Python's pickle can run arbitrary code while loading, so a crafted payload gives code execution in the process that loads it. serialize does the reverse, JSON first and pickle as the fallback. The advisory frames the root cause as an insecure fallback without input validation, and CWE-1112 reflects that this was under-documented.
The attacker must get a malicious serialized context in front of the app. That happens where an application restores Context from a source others can write to: a shared database or cache, an uploaded file, a request body or a message queue. Without such a path, the code is not reachable. The CVSS vector shows high complexity and user interaction required, and scores the impact as low across the board, but a successful pickle load is full code execution as the application user.
Teams that persist workflow state between runs, for example agent workflows resumed from storage, should check where that storage can be written.
Who is affected
The package data lists llama-index-core from 0.11.15 through 0.12.40. The advisory text says v0.12.27 through v0.12.40, so the range differs between the two. Check any version in the wider span. Only code that calls Context.from_dict or the serializer on data from outside is at risk.
pip show llama-index-coreSearch your code for JsonPickleSerializer, PickleSerializer, and Context from_dict calls.
llama-index-core
- Ecosystem
- PyPI
- Affected
- >= 0.11.15, <= 0.12.40
- Fixed in
- 0.12.41
- Check
pip show llama-index-core
How to fix it
Upgrade to llama-index-core 0.12.41.
pip install --upgrade "llama-index-core>=0.12.41"The fix commit renames JsonPickleSerializer to PickleSerializer and keeps the old name as an alias, so imports still work. The deserialize docstring now warns to deserialize only what you deem safe. The method bodies are unchanged, so upgrading alone does not remove the pickle path. You must make sure serialized context never comes from an untrusted source. Sign or encrypt stored state, restrict who can write to it, or use the JSON serializer where you can.
How to tell if you were hit
Find where your app loads serialized workflow context and who can write to that store. Review it for entries you did not create, and for unexpected child processes, outbound connections or file writes from the process that restores context. Check lockfiles and images for llama-index-core below 0.12.41. A search for pickle opcodes or unusual module references such as os or subprocess in stored context blobs can flag tampering.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Incomplete Documentation of Program Execution exists in the run-llama/llama_index library's JsonPickleSerializer component, affecting versions v0.12.27 through v0.12.40. This vulnerability allows remote code execution due to an insecure fallback to Python's pickle module. JsonPickleSerializer prioritizes deserialization using pickle.loads(), which can execute arbitrary code when processing untrusted data. Attackers can exploit this by crafting malicious payloads to achieve full system compromise. The root cause involves the use of an insecure fallback strategy without sufficient input validation or protective safeguards. Version 0.12.41 renames JsonPickleSerializer to PickleSerializer and adds a warning to the docs to only use PickleSerializer to deserialize safe things.
Questions
- Does upgrading to 0.12.41 remove the pickle risk?
No. The fix commit only renames the class to PickleSerializer, keeps an alias, and adds a warning to the docstring. Deserialize still tries pickle first. You must keep untrusted data out of it.
- When is CVE-2025-3108 exploitable?
When an attacker can supply serialized context that the app restores through this serializer, such as from a shared store or an upload. The CVSS vector shows high complexity and user interaction.
- Which versions are listed as affected?
The package data says llama-index-core 0.11.15 through 0.12.40. The advisory text says 0.12.27 through 0.12.40. The patched version is 0.12.41.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More LlamaIndex vulnerabilities
All LlamaIndex entriesCVE-2025-6208
llama-index-core vulnerable to Uncontrolled Resource Consumption
medium5.3Feb 2, 2026CVE-2025-7707
llama-index has Insecure Temporary File
high7.1Oct 13, 2025CVE-2025-7647
llama-index-core insecurely handles temporary files
high7.3Sep 27, 2025CVE-2025-5302
LlamaIndex affected by a Denial of Service (DOS) in JSONReader
high8.6Aug 26, 2025CVE-2025-6211
LlamaIndex vulnerable to data loss through hash collisions in its DocugamiReader class
medium6.5Jul 10, 2025CVE-2025-5472
LlamaIndex vulnerable to DoS attack through uncontrolled recursive JSON parsing
medium6.5Jul 7, 2025
