LlamaIndex affected by a Denial of Service (DOS) in JSONReader
The JSONReader component in LlamaIndex parsed deeply nested JSON without a depth limit, so a crafted file could exhaust Python's recursion limit and crash the process. An attacker who can supply a JSON file could cause a denial of service through high resource consumption.
run-llama/llama_index
Originally disclosed on huntr
A denial of service vulnerability exists in the JSONReader component of the run-llama/llama_index repository, specifically in version v0.12.37. The vulnerability is caused by uncontrolled recursion when parsing deeply nested JSON files, which can lead to Python hitting its maximum recursion depth limit. This results in high resource consumption and potential crashes of the Python process. The issue is resolved in version 0.12.38.
From the GitHub Advisory Database (GHSA-7753-xrfw-ch36, 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 JSON parser used by JSONReader had no limit on nesting depth, so deeply nested input drove recursion until Python's maximum recursion depth was reached.
Impact
An attacker who can get a deeply nested JSON file parsed could cause high resource consumption and crash the Python process, a denial of service.
What the attacker needed
Ability to supply a JSON file to JSONReader
The fix
The issue was fixed in version 0.12.38, which presumably adds a limit on nesting depth.
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.
A JSON file is a common text format for storing structured data, and it can contain objects inside objects, like boxes within boxes. If a program keeps opening each box without a limit, it can run out of stack space, which is the small area of memory used to track nested function calls, and crash. Here, a file with very deep nesting could make the reader crash the whole Python process.
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.