CVE-2024-12704: CWE-835 Loop with Unreachable Exit Condition in run-llama run-llama/llama_index
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.
AI Analysis
Technical Summary
CVE-2024-12704 identifies a Denial of Service vulnerability in the LangChainLLM class within the run-llama/llama_index repository, specifically version v0.12.5. The vulnerability arises in the stream_complete method, which executes the language model (llm) in a separate thread and retrieves its output through the get_response_gen method of the StreamingGeneratorCallbackHandler class. If the thread terminates abnormally before the _llm.predict method is executed—commonly triggered by providing input of an incorrect type—the get_response_gen function enters an infinite loop due to the absence of exception handling for this scenario. This infinite loop causes the process to consume CPU resources indefinitely, effectively resulting in a Denial of Service condition. The vulnerability is classified under CWE-835 (Loop with Unreachable Exit Condition) and has a CVSS v3.0 score of 7.5, indicating high severity. The attack vector is network-based with no required privileges or user interaction, making exploitation feasible remotely. No patches or fixes have been published yet, and no active exploits have been reported. The affected software is used in AI and natural language processing applications, where run-llama/llama_index serves as a framework for interfacing with language models. The lack of robust input validation and error handling in the threading logic is the root cause of this vulnerability.
Potential Impact
For European organizations, this vulnerability poses a significant risk of service disruption in AI-driven applications that utilize the run-llama/llama_index framework. A successful exploit can cause indefinite resource consumption leading to Denial of Service, impacting availability of critical AI services such as chatbots, automated customer support, or data processing pipelines. This can degrade user experience, interrupt business operations, and potentially cause cascading failures if dependent systems rely on these AI components. Given the increasing adoption of AI technologies across sectors like finance, healthcare, and manufacturing in Europe, the impact could be widespread. Additionally, organizations with compliance requirements around service availability and operational resilience (e.g., under GDPR or NIS Directive) may face regulatory scrutiny if disruptions occur. While confidentiality and integrity are not directly affected, the availability impact alone is substantial, especially for real-time or high-availability AI services.
Mitigation Recommendations
To mitigate this vulnerability, organizations should implement strict input validation to ensure only correctly typed inputs are passed to the LangChainLLM class, preventing thread failures triggered by malformed inputs. Developers should enhance the run-llama/llama_index codebase by adding robust exception handling around the thread execution and the get_response_gen method to detect and gracefully handle abnormal thread termination, thereby avoiding infinite loops. Monitoring and alerting on abnormal CPU or thread usage in systems running this software can provide early detection of exploitation attempts. Until an official patch is released, consider isolating the affected components within containerized or sandboxed environments to limit resource impact. Additionally, applying runtime protections such as watchdog timers or process supervisors can help terminate hung processes automatically. Engage with the vendor or open-source maintainers to track patch availability and apply updates promptly once released. Finally, conduct security testing and fuzzing on inputs to identify and remediate similar issues proactively.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland
CVE-2024-12704: CWE-835 Loop with Unreachable Exit Condition in run-llama run-llama/llama_index
Description
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.
AI-Powered Analysis
Technical Analysis
CVE-2024-12704 identifies a Denial of Service vulnerability in the LangChainLLM class within the run-llama/llama_index repository, specifically version v0.12.5. The vulnerability arises in the stream_complete method, which executes the language model (llm) in a separate thread and retrieves its output through the get_response_gen method of the StreamingGeneratorCallbackHandler class. If the thread terminates abnormally before the _llm.predict method is executed—commonly triggered by providing input of an incorrect type—the get_response_gen function enters an infinite loop due to the absence of exception handling for this scenario. This infinite loop causes the process to consume CPU resources indefinitely, effectively resulting in a Denial of Service condition. The vulnerability is classified under CWE-835 (Loop with Unreachable Exit Condition) and has a CVSS v3.0 score of 7.5, indicating high severity. The attack vector is network-based with no required privileges or user interaction, making exploitation feasible remotely. No patches or fixes have been published yet, and no active exploits have been reported. The affected software is used in AI and natural language processing applications, where run-llama/llama_index serves as a framework for interfacing with language models. The lack of robust input validation and error handling in the threading logic is the root cause of this vulnerability.
Potential Impact
For European organizations, this vulnerability poses a significant risk of service disruption in AI-driven applications that utilize the run-llama/llama_index framework. A successful exploit can cause indefinite resource consumption leading to Denial of Service, impacting availability of critical AI services such as chatbots, automated customer support, or data processing pipelines. This can degrade user experience, interrupt business operations, and potentially cause cascading failures if dependent systems rely on these AI components. Given the increasing adoption of AI technologies across sectors like finance, healthcare, and manufacturing in Europe, the impact could be widespread. Additionally, organizations with compliance requirements around service availability and operational resilience (e.g., under GDPR or NIS Directive) may face regulatory scrutiny if disruptions occur. While confidentiality and integrity are not directly affected, the availability impact alone is substantial, especially for real-time or high-availability AI services.
Mitigation Recommendations
To mitigate this vulnerability, organizations should implement strict input validation to ensure only correctly typed inputs are passed to the LangChainLLM class, preventing thread failures triggered by malformed inputs. Developers should enhance the run-llama/llama_index codebase by adding robust exception handling around the thread execution and the get_response_gen method to detect and gracefully handle abnormal thread termination, thereby avoiding infinite loops. Monitoring and alerting on abnormal CPU or thread usage in systems running this software can provide early detection of exploitation attempts. Until an official patch is released, consider isolating the affected components within containerized or sandboxed environments to limit resource impact. Additionally, applying runtime protections such as watchdog timers or process supervisors can help terminate hung processes automatically. Engage with the vendor or open-source maintainers to track patch availability and apply updates promptly once released. Finally, conduct security testing and fuzzing on inputs to identify and remediate similar issues proactively.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2024-12-17T10:58:19.646Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 68ef9b24178f764e1f470af3
Added to database: 10/15/2025, 1:01:24 PM
Last enriched: 10/15/2025, 1:23:25 PM
Last updated: 12/4/2025, 6:43:20 AM
Views: 20
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-13513: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in codejunkie Clik stats
MediumCVE-2025-11727: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in codisto Omnichannel for WooCommerce: Google, Amazon, eBay & Walmart Integration – Powered by Codisto
HighCVE-2025-11379: CWE-200 Exposure of Sensitive Information to an Unauthorized Actor in roselldk WebP Express
MediumCVE-2025-62173: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in FreePBX security-reporting
HighCVE-2025-64055: n/a
UnknownActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.