cve.bz

CVE-2024-12704 llamaindex llamaindex: Infinite Loop

7.5 highExploit referenceEPSS 0.8%Fix available

High (7.5) in llamaindex llamaindex. EPSS 0.8% estimated probability of exploitation activity in the next 30 days. Fixed in llama-index-core 0.12.6.

On this page
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.

Severity

CVSS 3.0

7.5 high
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
0.8% (unchanged from 0.8% a week ago; 0.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 59th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: partial, assessed 2025-03-20. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-835 Loop with Unreachable Exit Condition (Infinite Loop)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-12704 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-12704?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-12704?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-12704 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
run-llama/llama_indexbefore 0.12.6

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-j3wr-m6xh-64hgPyPIllama-index-core<0.12.60.12.6
PYSEC-2025-244PyPIllama-index<=0.12.5no fix published
PYSEC-2026-1563PyPIllama-index-core<0.12.60.12.6

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability marked as high severity rather than moderate due to its potential to cause a complete Denial of Service (DoS) in affected applications. This flaw can be triggered trivially by supplying an invalid input type.

Since there is no exception handling when the prediction thread terminates prematurely, the get_response_gen function enters an infinite loop, consuming CPU resources indefinitely. This not only disrupts service availability but can also impact multi-threaded environments where stalled threads accumulate, degrading overall system performance.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-service-api-rhel9Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-12704.

References

Check your stackJSON