NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LlamaIndex

CVE-2025-5472: LlamaIndex vulnerable to DoS attack through uncontrolled recursive JSON parsing

mediumCVSS 3.0 6.5GHSA-3wxx-q3gv-pvvv

The JSONReader in llama-index-core recursed without a depth limit, so a deeply nested JSON file raised RecursionError and crashed the application. Anyone who can get such a file ingested can cause a denial of service. Versions below 0.12.38 are listed as vulnerable. Upgrade llama-index-core to 0.12.38.

Published Jul 7, 2025 · Updated Jul 8, 2025 · Analysis Nov 1, 2026

What an attacker can do

JSONReader.load_data in llama_index/core/readers/json.py walks the JSON structure recursively to build documents. The advisory names an unsafe recursive traversal with no depth validation. A file nested thousands of levels deep exhausts the Python stack and raises RecursionError, which ends the request or the process if nothing catches it.

The attacker needs a way to get a JSON file into a pipeline that uses JSONReader. That could be an upload to a document-ingestion API, a file in a watched folder or a crawled data source. The CVSS vector shows network access, no privileges, user interaction required, and a high availability impact only. There is no data exposure and no code execution.

For a RAG service that ingests user files, one crafted upload can crash the worker. If the job is retried automatically, the crash can repeat and keep the service down until the bad file is removed.

Who is affected

The package data lists llama-index-core below 0.12.38 as vulnerable. The advisory description names version 0.12.28. Only code that loads JSON through JSONReader is exposed, and the risk is real when the input is not trusted. The meta package llama-index pulls in llama-index-core.

pip show llama-index-core

Search your code for JSONReader.

llama-index-core

Ecosystem
PyPI
Affected
< 0.12.38
Fixed in
0.12.38
Check
pip show llama-index-core

How to fix it

Upgrade to llama-index-core 0.12.38.

pip install --upgrade "llama-index-core>=0.12.38"

The fix commit, c032843, wraps the logic of load_data in a try block and catches RecursionError. On that error the reader emits a warning, Recursion error occurred while processing JSON data, and returns an empty list. It does not limit nesting depth, so deep input is still walked until the stack runs out. For untrusted files, also cap input size and nesting depth before they reach the reader, and handle empty results.

How to tell if you were hit

Look for RecursionError in ingestion logs, workers that crash or restart while processing JSON files, and on a patched version the warning text Recursion error occurred while processing JSON data. Find the input file that was being read when the failure began. Check for JSON files with very deep nesting from a single source. Check llama-index-core pins in every service that ingests JSON.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

The JSONReader in run-llama/llama_index versions 0.12.28 is vulnerable to a stack overflow due to uncontrolled recursive JSON parsing. This vulnerability allows attackers to trigger a Denial of Service (DoS) by submitting deeply nested JSON structures, leading to a RecursionError and crashing applications. The root cause is the unsafe recursive traversal design and lack of depth validation, which makes the JSONReader susceptible to stack overflow when processing deeply nested JSON. This impacts the availability of services, making them unreliable and disrupting workflows. The issue is resolved in version 0.12.38.

Questions

Can CVE-2025-5472 lead to code execution?

No. The effect is a crash from RecursionError. The CVSS vector shows high availability impact and no confidentiality or integrity impact.

Does 0.12.38 limit JSON nesting depth?

No. According to the fix commit, it catches RecursionError, warns, and returns an empty list. Documents from that file are silently dropped, so check for empty results in your pipeline.

Which version fixes it?

llama-index-core 0.12.38. Versions below it are listed as vulnerable.

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 entries