Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-86712

CVE-2026-86712: SiYuan Clipboard RCE Vulnerability

CVE-2026-86712 is a remote code execution flaw in SiYuan that exploits clipboard handling to execute malicious code with Node.js privileges. This article covers technical details, affected versions, and mitigation strategies.

Published:

CVE-2026-86712 Overview

CVE-2026-86712 is a remote code execution vulnerability in SiYuan, an open-source personal knowledge management application, affecting versions before 3.8.2. The flaw stems from the paste handler trusting the attacker-writable text/siyuan clipboard MIME type and skipping HTML sanitization. When a user pastes clipboard content originating from a malicious web page, injected scripts execute in the Node-enabled Electron desktop renderer. Successful exploitation grants full Node.js access through the Electron main process, allowing attackers to execute arbitrary commands on the host. The vulnerability is classified as Cross-Site Scripting [CWE-79] but escalates to full code execution due to the Electron runtime context.

Critical Impact

A single paste of attacker-controlled clipboard data into SiYuan grants arbitrary code execution on the desktop host through Node.js APIs exposed to the renderer.

Affected Products

  • SiYuan Note desktop application versions prior to 3.8.2
  • Electron-based SiYuan renderer with Node.js integration enabled
  • All operating systems supported by the SiYuan desktop client (Windows, macOS, Linux)

Discovery Timeline

  • 2026-09-08 - CVE-2026-86712 published to NVD
  • 2026-09-10 - Last updated in NVD database

Technical Details for CVE-2026-86712

Vulnerability Analysis

SiYuan's paste handler in app/src/protyle/util/paste.ts reads the custom text/siyuan clipboard MIME type to reconstruct internal document fragments during copy/paste between SiYuan instances. The handler treated the presence of text/siyuan as evidence that the payload originated from a trusted SiYuan session and bypassed HTML sanitization. Any origin can write arbitrary MIME types to the clipboard via the standard ClipboardEvent API, so a hostile web page can spoof this trust signal. Because the renderer process runs with Node.js integration enabled, injected <script> or event-handler payloads gain access to Electron's require, child_process, and filesystem APIs.

Root Cause

The root cause is missing output sanitization on an attacker-controlled input channel. The paste handler treated the text/siyuan MIME type and zero-width-space (ZWSP)-terminated text/plain variants as internal, trusted data. Neither the MIME type nor the ZWSP marker is authenticated, so external pages can forge both. The patch introduces a Lute.Sanitize() call over siyuanHTML before insertion into the editor DOM.

Attack Vector

An attacker hosts a web page that programmatically writes a crafted payload to the user's clipboard, either through a copy event handler or the asynchronous Clipboard API. The victim then pastes into any SiYuan document. The handler parses the forged text/siyuan blob and injects unsanitized HTML into the renderer, where script execution proceeds with Node privileges. User interaction is limited to a single paste action, and no authentication to SiYuan is required.

typescript
         }
     }
 
+    // 外部网页可通过 copy 事件伪造 text/siyuan 或 ZWSP 结尾的 text/plain,与内部数据混同,粘贴前统一消毒 https://github.com/siyuan-note/siyuan/security/advisories/GHSA-9rr9-pxr4-gcgc
+    if (siyuanHTML) {
+        siyuanHTML = Lute.Sanitize(siyuanHTML);
+    }
+
     if (!siyuanHTML && textHTML) {
         const officeList = convertOfficeLists(textHTML);
         textHTML = officeList.html;

Source: GitHub Commit 9ce66065. The patch routes clipboard-derived HTML through Lute.Sanitize() before it reaches the editor, closing the trust-mismatch between clipboard origin and paste handling.

Detection Methods for CVE-2026-86712

Indicators of Compromise

  • Unexpected child processes spawned by the SiYuan Electron process, especially cmd.exe, powershell.exe, bash, or sh.
  • Outbound network connections from the SiYuan process to non-SiYuan infrastructure shortly after user paste activity.
  • New or modified files under user profile directories written by the SiYuan renderer process.

Detection Strategies

  • Inventory endpoints running SiYuan and identify installations at versions earlier than 3.8.2 via software asset management.
  • Alert on process-lineage anomalies where the SiYuan binary spawns interpreters or scripting hosts, which is not typical behavior for a note-taking client.
  • Monitor Electron application telemetry for unexpected require() usage or invocations of child_process originating from renderer contexts.

Monitoring Recommendations

  • Enable endpoint detection and response (EDR) telemetry on developer and knowledge-worker workstations where SiYuan is common.
  • Correlate browser activity with paste-triggered process launches to surface clipboard-based delivery.
  • Track network egress from the SiYuan process to identify command-and-control traffic following successful exploitation.

How to Mitigate CVE-2026-86712

Immediate Actions Required

  • Upgrade SiYuan to version 3.8.2 or later on all desktop endpoints. See the GitHub Release v3.8.2.
  • Advise users to avoid pasting content from untrusted web pages into SiYuan until the patch is deployed.
  • Review recent SiYuan process activity for signs of exploitation on unpatched endpoints.

Patch Information

The fix is delivered in SiYuan v3.8.2 via commit 9ce66065, which sanitizes siyuanHTML with Lute.Sanitize() before the paste handler injects it into the editor. Full details are published in the GitHub Security Advisory GHSA-9rr9-pxr4-gcgc and the VulnCheck Advisory Siyuan RCE.

Workarounds

  • Restrict SiYuan usage to trusted content sources until the upgrade is applied across the fleet.
  • Use application control policies to block execution of scripting interpreters spawned by the SiYuan Electron process.
  • Where feasible, run SiYuan inside a sandboxed user profile with limited filesystem and network access to constrain post-exploitation impact.
bash
# Verify installed SiYuan version and confirm patched build
siyuan --version
# Expected output: 3.8.2 or later

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.