Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain document-ingestion access to LightRAG
-
DeliveryStore raw HTML/iframe srcdoc or loose Mermaid payload
-
ExploitVictim runs query returning content
-
Executionreact-markdown renders unsanitized HTML as active
-
PersistScript executes in WebUI origin
-
ImpactExfiltrate localStorage API token, act as victim
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires LightRAG prior to 1.5.5 with the React WebUI in use. The attacker must be able to add/ingest a document whose content is returned through the query path (multi-user, shared-corpus, or untrusted-source ingestion deployments are most exposed). A victim user must then run a query that surfaces the poisoned content and view it in the WebUI, so exploitation depends on user interaction. The technical sinks are ChatMessage.tsx rendering answer and thinking content via react-markdown with rehypeRaw and skipHtml=false and no HTML sanitizer, plus the Mermaid securityLevel 'loose' path injecting generated SVG via innerHTML; payloads such as an iframe srcdoc or a crafted Mermaid block execute JavaScript in the WebUI origin. Limiting factors: victim must retrieve and view the content, the attacker needs ingestion capability, and instances that never ingest untrusted documents are effectively not exploitable. |
| Impact | This is a stored/DOM cross-site scripting flaw (CWE-79) in the LightRAG WebUI, scored 6.1 by the vendor (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N). The network vector and low complexity are real, but two factors temper raw severity: it requires user interaction (a victim must retrieve and view the poisoned content) and it requires the attacker to first have the ability to ingest a document into the corpus, which is a genuine precondition even though the vendor marked PR:N. No EPSS score, KEV listing, or public POC was provided in the intelligence, so by the precision rules this is 'no public exploit identified at time of analysis' - not confirmed exploitation. The impact is bounded to C:L/I:L (theft of the API token in localStorage and performing API actions as the victim within the WebUI origin), with no availability impact. Net: a legitimate, patch-worthy web-app XSS but not an urgent internet-wide emergency - priority is driven by whether an instance accepts documents from untrusted or multi-tenant sources. Signals are internally consistent (advisory, PR, commit, and release all confirm the fix); the main gap is the absence of exploitation-probability data (EPSS/KEV/POC all unstated). |
| Exploit ScenarioDerived | An attacker with the ability to add a document to a LightRAG instance stores raw HTML - for example an iframe with a malicious srcdoc, or a Mermaid code block leveraging the loose security level - inside content that the query path will return. When a legitimate user later runs a query that surfaces that content, MessageMarkdown renders it as active HTML (skipHtml=false, no sanitizer), executing attacker JavaScript in the WebUI origin to steal the API token from localStorage and perform API actions as the victim. No public exploit code was identified in the provided intelligence. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 22, 2026
Stored cross-site scripting (CWE-79) in the LightRAG WebUI prior to 1.5.5 lets an attacker who can ingest a document persist raw HTML that the query path later returns and renders as active content, executing JavaScript in the WebUI origin for any user who views the poisoned answer. The vulnerable sinks are ChatMessage.tsx, which renders answer and thinking content through react-markdown with rehypeRaw and skipHtml=false but no HTML sanitizer, and a Mermaid rendering path configured with securityLevel 'loose' that injects generated SVG via innerHTML; an attacker-supplied iframe srcdoc or crafted mermaid block is sufficient to run script. Successful exploitation lets the attacker read the API token held in the victim's localStorage and perform API actions as that user, so the assessed scope is changed (S:C) with limited confidentiality and integrity impact. The assessed vector is CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N (6.1), meaning the attacker requires authenticated ingestion capability and the victim must run a query that surfaces the content and view it in the WebUI; no public exploit identified at time of analysis and no confirmed active exploitation (CISA KEV).
RemediationAI
Upgrade to LightRAG 1.5.5 or later - this is the vendor-released patch and the only complete fix; the release (https://github.com/HKUDS/LightRAG/releases/tag/v1.5.5, advisory https://github.com/HKUDS/LightRAG/security/advisories/GHSA-xpjq-3w4w-w5wr, PR https://github.com/HKUDS/LightRAG/pull/3437) adds rehype-sanitize 6.0.0 with the chatMarkdownSanitizeSchema applied to both answer and thinking Markdown, sets Mermaid to securityLevel: 'strict' with trust: false, and disables the raw-HTML/innerHTML path. If immediate upgrade is not possible, compensate by treating every ingested document as hostile: restrict ingestion to a trusted, curated set of sources and keep untrusted corpora in separate instances so poisoned content cannot reach other users' queries - the trade-off is loss of open ingestion and added operational overhead. You can also reduce blast radius by not persisting the WebUI API token in localStorage (use short-lived or session-scoped tokens and separate origins for the WebUI versus the API), and by serving the WebUI under a strict Content-Security-Policy that forbids inline and framed script - noting that iframe srcdoc and Mermaid innerHTML sinks can still be reached in browsers that do not fully enforce frame-src/script-src for srcdoc, so CSP is supplementary rather than a fix. Disabling Mermaid diagram rendering in the WebUI also removes the innerHTML sink, at the cost of losing diagram output, and note that after upgrading Mermaid 'strict' mode disables interactive diagrams and HTML labels while the sanitizer strips raw HTML from answers, which may alter rendered output for legitimate documents containing embedded markup.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
LightRAG is a retrieval-augmented generation framework whose React-based WebUI (lightrag_webui) renders retrieved answer and 'thinking' content as Markdown. The root cause is CWE-79: the rendering pipeline combined react-markdown with the rehypeRaw plugin and skipHtml=false, which parses and re-emits raw HTML from ingested documents, but no sanitizer was in place, so attacker-controlled HTML nodes reached the DOM. A second sink existed in the code-highlight/diagram component, which initialized Mermaid with securityLevel: 'loose' and then injected the generated SVG through innerHTML; 'loose' disables Mermaid's built-in DOMPurify output sanitization and enables HTML labels and click-driven JavaScript, turning a fenced `mermaid` block from ingested content into a script sink. Because the payload is stored in the corpus and delivered through the ordinary query flow rather than reflected in a URL, the result is a stored/DOM XSS running in the LightRAG WebUI origin, where the API token is kept in localStorage - giving the injected script the same origin privileges as the application and enabling token theft plus authenticated API calls as the victim. The fix in 1.5.5 adds rehype-sanitize 6.0.0 (with hast-util-sanitize 5.0.2) and a project-defined chatMarkdownSanitizeSchema applied before rendering, and changes Mermaid to securityLevel: 'strict' with trust: false.
Know when Lightrag gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Attacker needs document-ingestion capability (PR:L) and a victim must view results (UI:R); script escapes into the browser origin (S:C) yielding limited token/action exposure (C:L/I:L, A:N).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
LightRAG provides simple and fast retrieval-augmented generation. Prior to 1.5.5, lightrag_webui/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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Cross-origin data theft in LightRAG server versions prior to 1.5.4 allows any malicious website to make authenticated, c
Server-side request forgery (CWE-918) in LightRAG before 1.5.5 lets an authenticated caller who can upload a Markdown or
Password recovery via a timing oracle in LightRAG's /login endpoint lets remote, unauthenticated attackers (CVSS PR:N/UI
Authentication bypass in HKUDS LightRAG before 1.5.4 lets a remote unauthenticated attacker defeat X-API-Key protection
Unthrottled password guessing against the LightRAG POST /login endpoint allows an unauthenticated remote attacker to sub
LightRAG API server versions prior to 1.5.5 return raw Python exception text to network clients through error handlers i
EUVD-2026-84550
GHSA-xpjq-3w4w-w5wr
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB