/

CVE-2026-65606

Severity:

CRITICAL RISK

(9.6)

XSS (CWE-79) via SiYuan custom protocol tab header

CVE-2026-65606

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Arbitrary Code Execution on Desktop Host

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SiYuan Desktop before v3.7.2 contains a cross-site scripting vulnerability in its siyuan:// protocol handler that injects unescaped icon parameters into a tab header via innerHTML.

On systems where the renderer runs with nodeIntegration enabled, this client-side XSS can be escalated to arbitrary operating-system command execution through access to Node APIs.

Affected context

This vulnerability occurs in SiYuan Desktop when handling siyuan://plugins/<name> links that reference a plugin name not currently installed.

In these cases, the application creates a custom tab and uses the link's icon parameter as HTML for the tab header without escaping or sanitization.

On Electron-based deployments where nodeIntegration is set to true in the renderer, any JavaScript executed in this context can reach Node's require function and spawn local processes.

Exploit preconditions

  • Attack surface: SiYuan Desktop application via siyuan:// URL handling and plugin links.
  • Required access: Ability to cause the victim application to open a crafted siyuan://plugins/<name> link (e.g., through a hyperlink, document, or URL handler invocation).
  • Trigger point: Opening a plugins/<name> link pointing to a non-installed plugin, with a malicious icon parameter that is inserted into the tab header via innerHTML.
  • Why exploitation is possible: The icon parameter is treated as trusted HTML and written directly into the DOM without escaping or sanitization. In an Electron renderer with nodeIntegration:true, injected script can access Node APIs such as require('child_process'), turning a browser-context XSS into native command execution.

Why this happens

The underlying bug is unsafe handling of user-controlled HTML in the application's UI, mapping directly to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The siyuan:// protocol handler passes the icon parameter from a plugins/<name> link into a tab header using innerHTML, assuming the value is benign markup.

Because there is no escaping, filtering, or content policy enforcement, attackers can supply elements with JavaScript event handlers (e.g., <img onerror=...>), causing script execution in the renderer.

In the specific Electron configuration with nodeIntegration:true, this script runs with elevated capabilities, enabling access to Node's module system and local OS command execution, extending a client-side scripting bug into a host-level code execution issue.

Potential impact

  • Malicious JavaScript may execute within the SiYuan Desktop renderer context.
  • Attackers could access Node's require API and execute arbitrary operating-system commands.
  • The local user account's data and files could be read, modified, or exfiltrated.
  • The integrity of documents and notes managed by SiYuan can be altered or corrupted.
  • The compromised host may be used as a foothold for further lateral movement in the user's environment.

General mitigation guidance

Effective mitigations focus on removing direct injection of untrusted HTML and reducing renderer privileges.

Common defensive patterns include:

  • Treating protocol handler parameters as untrusted input and applying robust HTML escaping or sanitization before inserting into the DOM.
  • Avoiding innerHTML for UI composition; prefer safe DOM APIs that do not interpret raw markup from external input.
  • Applying a security-conscious Electron configuration: disabling nodeIntegration in renderer processes by default and separating browser UI from privileged Node functionality.
  • Introducing clear trust boundaries so that data originating from links, URLs, or external documents cannot directly influence privileged UI components.
  • Leveraging content security policies and strict type validation for protocol parameters (e.g., icon should be constrained to URLs or known-safe tokens).

How teams detect issues like this

Detection can rely on a combination of code-level and configuration-level checks:

  • Static analysis rules that flag use of innerHTML, outerHTML, or similar sinks when they receive data derived from URLs, protocol handlers, or other untrusted sources.
  • Code review practices that scrutinize Electron-specific configurations, especially nodeIntegration and access to require in renderer processes.
  • Security-oriented linters or automated review tools that highlight XSS-prone patterns and unsafe DOM construction in TypeScript/JavaScript code.
  • Policy enforcement that requires sanitization or encoding of all data passed from custom protocol handlers into UI components.
  • Runtime instrumentation or logging that can surface unexpected protocol parameter values and anomalous script execution behaviors in the renderer.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/commit/41f2861c87575ff5ac4b50a0520b1a4fe55b4a70
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-wp64-x7qh-h728
vulncheck.comvulncheck.com/advisories/siyuan-before-cross-site-scripting-to-rce

Frequently asked

questions

It can be triggered remotely in the sense that an attacker can deliver a crafted siyuan://plugins/<name> link via email, chat, or web content, but successful exploitation still depends on a user's SiYuan Desktop opening the link and processing it in a vulnerable renderer.

The attacker does not need direct filesystem or application access; they only need a way to induce the victim to follow or open a malicious siyuan://plugins/<name> link. Once the link is processed, injected JavaScript can run with the renderer's privileges.

The safest high-level fix is to avoid interpreting untrusted input as HTML or script. This typically means eliminating innerHTML for user-derived data, enforcing strict encoding/sanitization of protocol parameters, and running UI renderers without direct access to Node or OS-level APIs.

Future prevention depends on adopting secure design defaults: treat all external input as untrusted, encapsulate protocol handlers behind validation and sanitization layers, configure Electron with least-privilege renderer settings, and integrate static analysis and security-focused code review to catch XSS-prone patterns early in the development lifecycle.

Find out what's already
exploitable in your codebase.