CVE-2026-86062: LightRAG: Stored Cross-Site Scripting (XSS) in the LightRAG WebUI chat/answer renderer via ingested content
LightRAG provides simple and fast retrieval-augmented generation. Prior to 1.5.5, lightragwebui/src/components/retrieval/ChatMessage.tsx renders answer and thinking content with react-markdown, rehypeRaw, and skipHtml=false without an HTML sanitizer. An attacker who can add a document can store raw HTML that is returned through the query path and rendered as active content by MessageMarkdown. A user who later retrieves the content can execute attacker-controlled JavaScript through elements such as an iframe srcdoc; the additional Mermaid securityLevel: loose rendering path also injects generated SVG through innerHTML. The script runs in the LightRAG WebUI origin and can read the API token in localStorage and perform API actions as the victim. This issue is fixed in version 1.5.5.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
LightRAGto a version that resolves this vulnerability.Fixed in 1.5.5
Event History
Frequently Asked Questions
What must occur for the payload to execute?
An attacker must first add a document containing malicious content. A user must then retrieve that content through the query path so that the WebUI renders it.
What components and content paths are involved?
The affected rendering occurs in the WebUI's ChatMessage.tsx for answer and thinking content. The Mermaid rendering path is also relevant because it injects generated SVG using innerHTML with Mermaid securityLevel set to loose.
What version should be deployed to remediate the issue?
Upgrade LightRAG to version 1.5.5, which fixes this issue. Versions prior to 1.5.5 are affected.