LlamaIndex Improper Handling of Exceptional Conditions vulnerability
The stream_complete method in the LangChainLLM class starts a thread to run the LLM and then waits for a response generator. If the thread dies before the LLM call happens, no exception is handled and the generator loops forever, so a malformed input can hang the process indefinitely.
run-llama/llama_index
Originally disclosed on huntr
A vulnerability in the LangChainLLM class of the run-llama/llama_index repository, version v0.12.5, allows for a Denial of Service (DoS) attack. The stream_complete method executes the llm using a thread and retrieves the result via the get_response_gen method of the StreamingGeneratorCallbackHandler class. If the thread terminates abnormally before the _llm.predict is executed, there is no exception handling for this case, leading to an infinite loop in the get_response_gen function. This can be triggered by providing an input of an incorrect type, causing the thread to terminate and the process to continue running indefinitely.
From the GitHub Advisory Database (GHSA-j3wr-m6xh-64hg, 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
Likely the response generator lacks a check for the worker thread dying before it produces output, so it waits in an infinite loop instead of raising an error.
Impact
An attacker could cause a denial of service by supplying an input of the wrong type, making the process run indefinitely.
What the attacker needed
Ability to send input to stream_complete
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.
This is a denial-of-service bug: a program gets stuck and stops doing useful work. The code starts a background worker (a thread) to ask a language model for an answer, then waits for that worker to hand back results. If the worker crashes early, the waiting code never checks for that and keeps waiting forever, so the whole service can freeze.
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.