Skip to main content

CVE-2025-5472: CWE-674 Uncontrolled Recursion in run-llama run-llama/llama_index

Medium
VulnerabilityCVE-2025-5472cvecve-2025-5472cwe-674
Published: Mon Jul 07 2025 (07/07/2025, 09:55:56 UTC)
Source: CVE Database V5
Vendor/Project: run-llama
Product: run-llama/llama_index

Description

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.

AI-Powered Analysis

AILast updated: 07/07/2025, 10:26:12 UTC

Technical Analysis

CVE-2025-5472 is a medium-severity vulnerability affecting the JSONReader component of the run-llama/llama_index library, specifically version 0.12.28. The vulnerability arises from an uncontrolled recursion issue during JSON parsing, where the JSONReader recursively traverses JSON structures without enforcing any depth limits. This design flaw allows an attacker to craft deeply nested JSON payloads that cause the parser to exceed the call stack limit, resulting in a stack overflow and a RecursionError. The immediate consequence is a Denial of Service (DoS) condition, as the affected application crashes or becomes unresponsive when processing such malicious input. The vulnerability impacts availability but does not compromise confidentiality or integrity, as no unauthorized data access or modification is involved. The root cause is the lack of depth validation in the recursive parsing logic, which is unsafe for untrusted input. This issue is resolved in run-llama/llama_index version 0.12.38, where presumably depth checks or iterative parsing methods have been introduced to prevent stack overflow. The CVSS v3.0 score is 6.5, reflecting a network attack vector with low attack complexity, no privileges required, but requiring user interaction (i.e., the attacker must submit crafted JSON to the application). No known exploits are currently reported in the wild. This vulnerability is classified under CWE-674 (Uncontrolled Recursion), highlighting the importance of safe recursion practices in software development.

Potential Impact

For European organizations using run-llama/llama_index version 0.12.28 or earlier, this vulnerability poses a risk to service availability. Applications relying on this library for JSON parsing could be disrupted by attackers submitting maliciously crafted deeply nested JSON data, causing crashes and denial of service. This can interrupt business workflows, degrade user experience, and potentially lead to operational downtime. Sectors with high reliance on automated data processing, such as finance, healthcare, and critical infrastructure, may face increased operational risk. While the vulnerability does not allow data breaches or integrity violations, the availability impact can indirectly affect compliance with regulations like GDPR if service interruptions lead to failure in meeting service level agreements or data processing obligations. Additionally, organizations exposed to internet-facing services that accept JSON input are more vulnerable to remote exploitation attempts. The lack of known exploits reduces immediate risk but does not eliminate the threat, especially as attackers may develop exploits following public disclosure.

Mitigation Recommendations

European organizations should promptly upgrade run-llama/llama_index to version 0.12.38 or later, where the vulnerability is fixed. Until the upgrade is applied, implement input validation to limit the depth of JSON structures accepted by applications using this library. Employ application-layer firewalls or JSON schema validators that reject excessively nested JSON payloads. Monitor application logs for RecursionError or stack overflow exceptions indicative of exploitation attempts. Consider sandboxing or isolating JSON parsing components to contain potential crashes and prevent cascading failures. Educate developers on safe recursion practices and encourage use of iterative parsing techniques or libraries with built-in depth limits. For critical systems, conduct penetration testing to verify resilience against deeply nested JSON inputs. Maintain an inventory of all applications and services using run-llama/llama_index to ensure comprehensive patching. Finally, implement rate limiting and anomaly detection on endpoints accepting JSON input to reduce attack surface.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
@huntr_ai
Date Reserved
2025-06-02T14:07:59.604Z
Cvss Version
3.0
State
PUBLISHED

Threat ID: 686b9cd26f40f0eb72e2e26c

Added to database: 7/7/2025, 10:09:22 AM

Last enriched: 7/7/2025, 10:26:12 AM

Last updated: 7/7/2025, 11:39:21 AM

Views: 2

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats