CVE-2025-6211: LlamaIndex vulnerable to data loss through hash collisions in its DocugamiReader class
The DocugamiReader in LlamaIndex built chunk IDs as an MD5 hash of the chunk text alone. Two chunks with identical text but different positions in the document got the same ID, so one overwrote the other. This loses document content and breaks parent-child links. Upgrade llama-index-readers-docugami to 0.3.1, or llama-index to 0.12.41.
Published Jul 10, 2025 · Analysis Nov 1, 2026
What an attacker can do
The flaw is in _build_framework_chunk() in llama-index-readers-docugami (llama_index/readers/docugami/base.py). It hashed only the chunk text with MD5 and stored the result under ID_KEY in the document metadata. Docugami documents often repeat text, such as the same clause in different sections. Chunks with the same text but different XPaths then collided, and a vector store or index that keys on that ID kept only one.
This is a data integrity problem, not a code execution bug. The advisory lists three results: loss of semantically or legally important content, broken parent-child chunk hierarchies, and inaccurate or hallucinated answers from the AI that relies on the index. An attacker who can supply documents, for example by uploading a contract, could craft repeated text to push out a chunk. The CVSS vector shows network access, no privileges, and low integrity and availability impact, with no confidentiality impact.
Retrieval-augmented apps that answer questions over legal or compliance documents ingested through DocugamiReader are the main concern.
Who is affected
Two package ranges are listed: llama-index below 0.12.41, and llama-index-readers-docugami below 0.3.1. Only applications that load documents with DocugamiReader are exposed. The advisory text also says the issue is resolved in 0.3.1, which is the reader package version.
pip show llama-index llama-index-readers-docugamiIndexes built before the upgrade may already be missing chunks.
llama-index
- Ecosystem
- PyPI
- Affected
- < 0.12.41
- Fixed in
- 0.12.41
- Check
pip show llama-index
llama-index-readers-docugami
- Ecosystem
- PyPI
- Affected
- < 0.3.1
- Fixed in
- 0.3.1
- Check
pip show llama-index-readers-docugami
How to fix it
Upgrade to llama-index-readers-docugami 0.3.1, or llama-index 0.12.41.
pip install --upgrade "llama-index-readers-docugami>=0.3.1"The fix changes _build_framework_chunk() so the ID is the MD5 of the chunk's XPath, a newline and its text. Same-text chunks at different XPaths now get different IDs. Upgrading does not repair indexes you already built. Re-ingest the Docugami documents into a fresh index to restore the lost chunks.
How to tell if you were hit
Compare the number of chunks the reader returns with the number of distinct IDs in your index or vector store. A smaller count of stored chunks than chunks produced points to collisions. Look at metadata under ID_KEY for duplicates among documents with different XPath values. Test known documents with repeated clauses and check whether answers cite only one of the copies. Check installed package versions in each environment that ingests Docugami data.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A vulnerability in the DocugamiReader class of the run-llama/llama_index repository, up to but excluding version 0.12.41, involves the use of MD5 hashing to generate IDs for document chunks. This approach leads to hash collisions when structurally distinct chunks contain identical text, resulting in one chunk overwriting another. This can cause loss of semantically or legally important document content, breakage of parent-child chunk hierarchies, and inaccurate or hallucinated responses in AI outputs. The issue is resolved in version 0.3.1.
Questions
- Does CVE-2025-6211 let an attacker run code?
No. It is a data loss and integrity flaw. Chunks with identical text overwrite each other, which can drop content and corrupt hierarchies, leading to wrong answers.
- Which versions fix the DocugamiReader collision?
llama-index-readers-docugami 0.3.1 and llama-index 0.12.41 are the patched versions in the package data.
- Do I need to rebuild my index after upgrading?
Yes, if it holds Docugami chunks from before the fix. The upgrade changes how new IDs are made, but does not restore chunks that were overwritten. The sources do not state this explicitly, so verify chunk counts.
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-3108
LlamaIndex has Incomplete Documentation of Program Execution related to JsonPickleSerializer component
medium5.0Jul 7, 2025CVE-2025-5472
LlamaIndex vulnerable to DoS attack through uncontrolled recursive JSON parsing
medium6.5Jul 7, 2025
