CVE-2026-86712 in SiYuan
Summary
by MITRE • 09/08/2026
SiYuan before 3.8.2 trusts the attacker-writable text/siyuan clipboard MIME type and skips sanitization in the paste handler, allowing code execution in the Node-enabled desktop renderer. Attackers can craft malicious web pages that write to the clipboard, and when pasted into SiYuan, injected scripts execute with full Node.js access through the Electron main process.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 09/08/2026
The vulnerability identified in versions of SiYuan prior to 3.8.2 represents a critical security flaw rooted in improper input validation and trust assumptions within the application's clipboard handling mechanism. Specifically, the software fails to adequately sanitize or validate the MIME type associated with text content copied from external sources before processing it during paste operations. This oversight allows an attacker who can influence the system clipboard to inject malicious payloads that bypass standard sanitization routines designed for rich text editors. The core technical failure lies in the application's reliance on the presence of a specific MIME type, namely text/siyuan, which is writable by external processes or web pages interacting with the browser context. By trusting this attribute without rigorous verification against expected safe formats, SiYuan inadvertently creates an execution path for arbitrary code within its desktop renderer environment.
From a technical perspective, this flaw exploits the integration between the Electron framework and Node.js enabled in the desktop application's rendering process. When a user pastes content crafted by an attacker into the editor, the injected script is not stripped or escaped as intended due to the skipped sanitization step. Instead, the malicious code executes within the context of the renderer, which possesses elevated privileges because it runs with Node.js capabilities enabled. This architecture allows the payload to escape the sandboxed browser environment and interact directly with the operating system through the Electron main process interface. Consequently, an attacker can achieve remote code execution by simply tricking a victim into pasting content from a malicious web page or other source that has written harmful scripts to the clipboard using standard JavaScript APIs like document.execCommand or modern Clipboard API implementations.
The operational impact of this vulnerability is severe, as it effectively grants full control over the affected system under the context of the user running SiYuan. Since Node.js provides access to file systems, network sockets, and child processes, an attacker can read sensitive files, exfiltrate data stored locally by the application, or install additional malware on the host machine. This scenario aligns with CWE-94 Improper Control of Generation of Code (Code Injection) as well as CWE-798 Use of Hard-coded Credentials if such credentials are accessed via the executed code. Furthermore, in terms of adversary tactics, this vulnerability facilitates techniques described in MITRE ATT&CK under Command and Scripting Interpreter for executing arbitrary commands and potentially Access Token Manipulation or System Binary Proxy Execution depending on how the injected scripts leverage system utilities to maintain persistence or escalate privileges beyond the initial application context.
Mitigation strategies must prioritize immediate updates to version 3.8.2 or later, where these sanitization checks have been reinforced to strictly validate input types and strip potentially dangerous content before rendering. For organizations unable to patch immediately, disabling Node.js integration in the renderer process is a critical defensive measure that would sandbox web content more effectively, preventing scripts from accessing system-level APIs even if they are injected via clipboard operations. Additionally, implementing strict Content Security Policy directives can help restrict script execution sources and reduce the attack surface for cross-site scripting variants that might be leveraged to populate malicious clipboard data. Users should also exercise caution when pasting content into rich text editors from untrusted or unknown origins until such patches are applied across their environments.