LlamaIndex Denial-of-Service Vulnerability (CVE-2024-12704)
A denial-of-service vulnerability was found in the LangChainLLM class of LlamaIndex. The flaw allowed an infinite loop to occur, rendering the system unresponsive.
An unhandled thread termination in the LangChainLLM class led to an infinite loop in the response generator.
Key facts
- What
- A denial-of-service vulnerability was found in the LangChainLLM class of LlamaIndex.
- Incident date
- Mar 20, 2025
- Who
- LlamaIndex
- Failure mode
- Brand & Safety Incident
- AI surface
- Agentic Workflow
- Severity
- High
What happened
LlamaIndex's LangChainLLM class in version 0.12.5 contained a vulnerability that could be exploited to cause a denial-of-service attack. The issue was publicly disclosed as CVE-2024-12704 and resolved in version 0.12.6. This vulnerability allowed an attacker to cause the process to hang indefinitely.
What broke inside the model
- 01 · TriggerA user prompts the model in public view.
- 02 · Model stepThe model produces unsafe or off-brand output.
- 03 · Control gapNo filter holds the line before publish.
- 04 · FailureThe output goes public unchecked.
- 05 · ConsequenceA reputational or safety incident lands.
A contained signal crosses into output that goes public.
The stream_complete method lacked exception handling for threads that terminated abnormally before the _llm.predict call. This resulted in an infinite loop within the get_response_gen function of the StreamingGeneratorCallbackHandler class when an incorrect input type was provided.
What it cost
Sources
- PrimaryCVE-2024-12704 - NVDnvd.nist.gov
- PrimaryLlamaIndex Improper Handling of Exceptional Conditions vulnerabilitygithub.com
- PressSecurity Risks of LLM Frameworks with Case Studiesflatt.tech
Cite this entry
https://failureindex.ai/failures/llamaindex-denial-service-vulnerability-cve-2024AI Failure Index. "LlamaIndex Denial-of-Service Vulnerability (CVE-2024-12704)" (FI-0566). Realm Labs. https://failureindex.ai/failures/llamaindex-denial-service-vulnerability-cve-2024 (indexed Jun 16, 2026).Data fields CC-BY 4.0, prose citation permitted. Incident ID FI-0566. Full dataset at /data.
Note from Realm Labs, the Index steward
How Realm would have caught this
- Prism
- OmniGuard
- AI Detection & Response (AIDR)
Realm watches the model's internal state for the signature of unsafe or off-brand generation and can block or reroute the output before it becomes public, in real time rather than after it has been screenshotted.