SiYuan agent chat panel renders final reply as raw HTML, enabling code execution

SiYuan's AI agent chat panel renders the final assistant message as unsanitized HTML, allowing injected event handlers to run operating-system commands in the desktop app's local-kernel mode.

Christopher Ort
By Christopher Ort · 3 min read
Share
A desktop computer screen showing a note-taking application with a chat interface, photographed from an angle in an office setting
Image: AI-generated, i10X
On this page
  1. Quick Take
  2. In plain English
  3. What happened
  4. Attack routes
  5. What you should do
  6. Sources
i10X Quick Take

Quick Take

  1. What: SiYuan’s AI agent chat panel renders the final assistant message as unsanitized HTML, creating a DOM cross-site scripting flaw that can execute operating-system commands in desktop local-kernel mode.
  2. Who is affected: SiYuan desktop users running versions 3.7.0 through 3.8.10 in local-kernel mode; remote-kernel mode applies a Content-Security-Policy without unsafe-inline.
  3. Fixed version: Advisory names v3.8.11, but only alpha pre-releases are published; v3.8.10 remains the latest stable release as of November 16, 2026.
  4. What to do: Treat the agent panel as untrusted until a stable release carries the fix, delete saved agent sessions that could hold a payload, and point the panel only at model endpoints you control.
  5. Attack routes: A model reproducing attacker-influenced markup it read (indirect prompt injection), or a configured model endpoint returning the markup directly.

In plain English

SiYuan is a note-taking app with an AI agent chat panel. The panel shows you clean text while the AI is typing its answer, but when the answer finishes, the app replaces that preview with the raw HTML version without checking it for dangerous code.

What you should do: If you use the desktop app in local-kernel mode (the default setup), a malicious answer can run commands on your computer with your user privileges. The problem affects versions 3.7.0 through 3.8.10. The maintainer published a fix in version 3.8.11, but only test versions are available; the stable release is still 3.8.10, which is vulnerable. If you use SiYuan’s AI chat feature, avoid it until a stable fix is released, delete any saved chat sessions, and only connect to AI services you trust completely.

What happened

SiYuan published advisory GHSA-3rvg-qxwg-f3c6 on November 11, 2026 for a DOM cross-site scripting flaw in its AI agent chat panel. The reporter is credited as president-xd. Versions 3.7.0 through 3.8.10 of the siyuan npm package are affected, and the advisory names v3.8.11 as the patched version. The maintainer scores the flaw 7.5.

The chat panel builds its Markdown engine without HTML sanitization enabled, then assigns the rendered assistant output to innerHTML. A second engine instance sanitizes the streaming preview, so a user sees clean text while the reply streams and the unsanitized body replaces it when the stream ends, stops or errors. Block-level raw HTML in a reply keeps its inline event-handler attributes, and attributes supplied through kramdown attribute-list syntax survive even where sanitization is on.

In desktop local-kernel mode the window runs with Node.js integration enabled and no active Content-Security-Policy, so a handler can call Node APIs and run operating-system commands with the user’s privileges. Remote-kernel mode applies a Content-Security-Policy without unsafe-inline.

Attack routes

The advisory describes two routes into the agent’s reply. Indirect prompt injection is the first: the agent reads attacker-influenced material and the model reproduces the malicious markup, a route the advisory calls probabilistic. A model endpoint the user configured, returning the markup directly, is the second and deterministic route. Saved sessions then re-execute the payload whenever they are reopened.

What you should do

SiYuan’s advisory names v3.8.11 as the patched version, but the project’s releases page shows only v3.8.11 alpha pre-releases, the most recent published on November 16, 2026. Version 3.8.10, released November 10, is still marked as the latest stable release and sits inside the affected range. Anyone waiting for a stable fix has nothing to install yet.

Treat SiYuan’s agent panel as untrusted until a stable release carries the fix. Delete saved agent sessions that could hold a payload, since reopening one runs it again, and point the panel only at model endpoints you control.

Sources

Christopher Ort

Christopher Ort

Christopher Ort handles SEO, AI agent workflows and PR & partnerships at i10x.ai, the all-in-one AI workspace built by i10X Global Pte. Ltd. in Singapore. He is a graduate of Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU). He is the author of “The Style Penalty”, a study published on SSRN that analyses 1,576 evaluation decisions by four frontier AI models to show how AI-written CVs fare in automated hiring screens; the research has been covered by heise online and t3n.

Editor's picks

  1. CVE-2026-129877: DeepAudit exposes LLM API keys and Git tokens to unauthenticated attackers
  2. CVE-2026-129875: REBUILD 4.5.0–4.5.4 password hash disclosure via MCP QueryRecords
  3. South Korea Weighs Nuclear Power to Meet AI Electricity Demand
  4. UK and US Partner to Accelerate Nuclear Fusion with AI
  5. Texas and New Mexico Data Center Emissions Rise With AI Buildout