Skip to content

Streaming Phase XSS to RCE via LLM Response Injection

Critical
timothycarambat published GHSA-rrmw-2j6x-4mf2 Mar 13, 2026

Package

anything-llm

Affected versions

<=1.11.1

Patched versions

9e2d144dc8be6fab29f560f5bcdaa9ef7dbb4214, 1.11.2+

Description

Summary

AnythingLLM Desktop (v1.11.1) contains a Streaming Phase XSS vulnerability in the chat rendering pipeline that escalates to Remote Code Execution on the host OS due to insecure Electron configuration. This works with default settings and requires no user interaction beyond normal chat usage.

Details

Root Cause

The custom markdown-it image renderer in frontend/src/utils/chat/markdown.js (lines 70-77) interpolates token.content directly into the alt attribute without HTML entity escaping. The PromptReply component (line 99) renders this output via dangerouslySetInnerHTML without DOMPurify sanitization — unlike HistoricalMessage (line 280) which correctly applies DOMPurify.sanitize().

Attack Vector

An attacker can trigger this vulnerability by embedding a prompt injection payload in a RAG document, controlling a malicious LLM endpoint, or compromising any upstream source that influences the model's response:
![" onerror="require('child_process').exec('open -a calculator')](x)
When a victim asks any question in that workspace, the LLM includes the payload in its streaming response. The custom image renderer produces:
<img src="x" alt="" onerror="require('child_process').exec('open -a calculator')" />
Because the Electron app is configured with nodeIntegration: true and contextIsolation: false, the onerror handler has direct access to Node.js APIs, resulting in arbitrary code execution.

PoC

poc.mov

Impact

Successful exploitation grants the attacker arbitrary code execution on the victim's operating system with the full privileges of the AnythingLLM Desktop process. This allows an attacker to:

  • Read and exfiltrate sensitive files (SSH keys, credentials, personal documents)
  • Install persistent backdoors or malware
  • Pivot to other systems on the local network
  • Fully compromise the confidentiality, integrity, and availability of the host

Credit

Jingcheng Yang, Zhengyu Liu, Jianjun Chen

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

CVE ID

CVE-2026-32626

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.

Credits