LlamaIndex vulnerable to DoS attack through uncontrolled recursive JSON parsing
The JSONReader component in LlamaIndex versions up to 0.12.28 recursively parses JSON without a depth limit, so a deeply nested JSON document causes a stack overflow and crashes the application. An attacker can submit such a document to trigger a denial of service, disrupting availability.
run-llama/llama_index
Originally disclosed on huntr
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.
From the GitHub Advisory Database (GHSA-3wxx-q3gv-pvvv, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The JSONReader traverses JSON recursively without validating nesting depth, so deeply nested input exhausts the call stack.
Impact
An attacker could cause a denial of service by crashing applications that process attacker-supplied JSON, making the service unreliable and disrupting workflows.
What the attacker needed
Ability to supply JSON to JSONReader
The fix
The issue was fixed in version 0.12.38.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
JSON is a common text format for structured data, and a parser reads it by walking through nested objects and arrays. If the parser uses recursion (a function that calls itself for each level of nesting) without a limit, a very deeply nested document can exhaust the program's call stack and crash it. Here, an attacker can send such a document to make the service unavailable.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.