CVE-2025-3044
Executive Summary
CVE-2025-3044 is a medium-severity vulnerability (CVSS 5.3) in the run-llama/llama_index Python library, specifically within the ArxivReader class. The vulnerability arises from the use of MD5 hashing to generate filenames for downloaded academic papers from ArXiv. Because MD5 is cryptographically broken and susceptible to collision attacks, two papers with different content but identical titles can produce the same MD5 hash. This results in one paper silently overwriting the other on disk, leading to data loss and incomplete AI model training datasets. The issue is resolved in version 0.12.28.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the llama-index PyPI package. Organizations using this package for data ingestion pipelines should verify their dependency version. The use of a weak hash (MD5) in a core data processing component introduces a supply chain risk, as malicious actors could craft papers with colliding titles to disrupt training data integrity.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attacker can submit a paper title remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required beyond normal operation.
- Scope (S): Unchanged (U) – The vulnerability does not affect other components.
- Confidentiality (C): None (N) – No data exposure.
- Integrity (I): None (N) – Data is not modified, only lost.
- Availability (A): Low (L) – Data loss reduces availability of training data.
Threat Level: Medium. While exploitation is straightforward, the impact is limited to data loss and does not allow code execution or data theft.
Deep Dive & Mechanics
The ArxivReader class in llama_index is designed to fetch papers from the ArXiv API based on a query. When a paper is downloaded, its filename is generated using an MD5 hash of the paper's title. The relevant code snippet (simplified) is:
import hashlib
def download_paper(paper):
title = paper.title
filename = hashlib.md5(title.encode()).hexdigest() + ".pdf"
# Save paper to disk using filename
Because MD5 is a 128-bit hash, collisions are possible. An attacker can submit two papers with different content but the same title (or titles that produce the same MD5 hash). When the second paper is downloaded, it overwrites the first file on disk. This means the first paper is permanently lost, and the training pipeline will only process the second paper.
The vulnerability is present in versions up to and including v0.12.22.post1. The fix in v0.12.28 replaces MD5 with a collision-resistant hash (likely SHA-256) or uses a combination of title and other metadata to generate unique filenames.
Vulnerable vs. Patched Code
Vulnerable Code (v0.12.22.post1):
import hashlib
class ArxivReader:
def load_data(self, query):
papers = self._fetch_papers(query)
for paper in papers:
filename = hashlib.md5(paper.title.encode()).hexdigest() + ".pdf"
self._save_paper(paper, filename)
Patched Code (v0.12.28):
import hashlib
class ArxivReader:
def load_data(self, query):
papers = self._fetch_papers(query)
for paper in papers:
# Use SHA-256 to avoid collisions
filename = hashlib.sha256(paper.title.encode()).hexdigest() + ".pdf"
self._save_paper(paper, filename)
The patch replaces md5 with sha256, which is collision-resistant and suitable for this use case.
Exploitation & Lab Setup
Red Team
To exploit this vulnerability, an attacker would need to:
- Identify a target system running
llama_indexwith theArxivReaderclass. - Craft two academic papers with different content but identical titles (or titles that produce the same MD5 hash).
- Submit both papers to the target system (e.g., via an API endpoint that triggers the
ArxivReader). - The second paper will overwrite the first, causing data loss.
Lab Setup:
# Create a Python environment with the vulnerable version
python3 -m venv exploit_env
source exploit_env/bin/activate
pip install llama-index==0.12.22.post1
# Simulate the vulnerability
python -c "
import hashlib
# Two different titles that produce the same MD5 hash (collision)
title1 = 'A' * 64
title2 = 'B' * 64 # In reality, you'd need to find actual colliding titles
# In a real scenario, you would use a precomputed collision
# For demonstration, we show the overwrite behavior
hash1 = hashlib.md5(title1.encode()).hexdigest()
hash2 = hashlib.md5(title2.encode()).hexdigest()
print(f'Hash1: {hash1}')
print(f'Hash2: {hash2}')
print(f'Collision: {hash1 == hash2}')
"
Blue Team
To detect exploitation attempts:
- Monitor file system events for rapid overwrites of PDF files in the data directory.
- Log all downloaded paper titles and their corresponding hashes.
- Implement integrity checks (e.g., file size comparison) before overwriting.
Detection Script:
import hashlib
import os
def detect_collision(filepath, title):
expected_hash = hashlib.md5(title.encode()).hexdigest()
actual_hash = os.path.basename(filepath).replace('.pdf', '')
if expected_hash != actual_hash:
print(f'Potential collision detected for {title}')
Indicators of Compromise (IOCs)
- File System: Multiple PDF files with identical filenames (same MD5 hash) in the data directory.
- Logs: Repeated download attempts for papers with the same title but different content.
- Network: Unusual ArXiv API requests for papers with identical titles.
- Hash Collision: MD5 hash collisions in the
llama_indexdata directory.
Detection Engineering
YARA Rule
rule CVE_2025_3044_MD5_Collision
{
meta:
description = "Detects MD5 hash usage in llama_index ArxivReader"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-3044"
strings:
$md5_usage = "hashlib.md5" ascii nocase
$arxiv_reader = "ArxivReader" ascii nocase
condition:
$md5_usage and $arxiv_reader
}
Sigma Rule
title: CVE-2025-3044 - MD5 Collision in llama_index ArxivReader
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects potential exploitation of MD5 collision in llama_index
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/python3'
CommandLine|contains: 'hashlib.md5'
condition: selection
falsepositives:
- Legitimate use of MD5 in other contexts
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-3044 - Potential MD5 Collision Exploit in llama_index";
flow:to_server;
content:"arxiv.org"; http_host;
content:"/abs/"; http_uri;
pcre:"/^[a-f0-9]{32}\.pdf$/U";
sid:1000001;
rev:1;
)
Remediation & Mitigation
- Immediate: Upgrade
llama-indexto version 0.12.28 or later. - Workaround: If upgrade is not possible, modify the
ArxivReaderclass to use SHA-256 or a combination of title and unique ID for filenames. - Monitoring: Implement file integrity monitoring on the data directory to detect unexpected overwrites.
- Validation: Add checks to ensure that downloaded papers are not overwriting existing files with different content.
Valters IT
Securing the digital frontier, one CVE at a time.