CVE-2026-74902 Overview
CVE-2026-74902 is a cross-site scripting vulnerability in SiYuan, a self-hosted personal knowledge management application, affecting versions prior to v3.7.4. The flaw resides in the file upload validation flow, which fails to escape filenames before inserting them into the Document Object Model (DOM) through insertAdjacentHTML. An attacker who convinces a user to drag, drop, or paste a maliciously named file into the editor achieves script execution inside the SiYuan renderer. Because SiYuan exposes privileged desktop APIs to its renderer, the resulting script execution escalates to arbitrary operating system command execution. The vulnerability is tracked under CWE-79 (Improper Neutralization of Input During Web Page Generation).
Critical Impact
A single interaction with a crafted filename produces XSS-to-RCE with full operating system command access under the user's account.
Affected Products
- SiYuan Note desktop application versions before v3.7.4
- SiYuan self-hosted knowledge management deployments accepting file uploads
- Any SiYuan client exposing the drag, drop, or paste upload flow
Discovery Timeline
- 2026-08-18 - CVE-2026-74902 published to the National Vulnerability Database
- 2026-08-18 - Last updated in NVD database
Technical Details for CVE-2026-74902
Vulnerability Analysis
SiYuan's file upload validation flow accepts filenames from user-controlled sources without HTML-escaping them. The client-side code then concatenates the raw filename into an HTML string and injects it into the editor DOM through insertAdjacentHTML. Any markup embedded in the filename is parsed as HTML rather than treated as text. Because SiYuan runs as a desktop application built on a web renderer, the executing script inherits the renderer's privileges. Those privileges include invoking native bridges that reach operating system command execution. The result is a browser-style XSS that pivots to full command execution on the host without a separate memory-corruption or authentication step.
Root Cause
The root cause is missing output encoding at a DOM sink. insertAdjacentHTML treats its input as HTML, so any special characters in the filename, including <script> tags or event-handler attributes on injected elements, are interpreted as executable markup. The validation layer sanitized file type and size but not the display representation of the filename.
Attack Vector
Exploitation requires local user interaction. An attacker crafts a file whose name contains an HTML or JavaScript payload, for example an image or attachment with script markup embedded in the filename. The victim drags, drops, or pastes that file into the SiYuan editor. During the upload validation flow, SiYuan writes the unescaped filename into the DOM through insertAdjacentHTML, executing the payload. The payload then calls SiYuan's exposed APIs to run operating system commands under the user's account. See the GitHub Security Advisory GHSA-jf56-jrhq-j2qp and the VulnCheck advisory for technical details.
Detection Methods for CVE-2026-74902
Indicators of Compromise
- Files with names containing HTML tags, angle brackets, or JavaScript event handlers such as onerror= or onload= present in SiYuan's asset directories
- Unexpected child processes spawned by the SiYuan desktop application, for example cmd.exe, powershell.exe, /bin/sh, or bash
- Outbound network connections from the SiYuan process to unrecognized hosts shortly after a file drag, drop, or paste event
- New or modified files in the user's home directory or SiYuan workspace immediately following an editor upload action
Detection Strategies
- Hunt process telemetry for the SiYuan binary as a parent of interpreter or shell processes
- Inspect SiYuan asset and workspace directories for filenames containing <, >, or JavaScript event-handler substrings
- Correlate user file upload activity with subsequent script interpreter execution on the same endpoint
- Alert on writes to autostart or persistence locations by processes descended from SiYuan
Monitoring Recommendations
- Enable endpoint process-tree logging for desktop note-taking and Electron-based applications
- Monitor command line arguments of shells spawned by SiYuan for encoded payloads or download primitives
- Log filesystem events in user-writable SiYuan workspace paths and review filename anomalies
- Track SiYuan version telemetry across the fleet to identify hosts still running versions earlier than v3.7.4
How to Mitigate CVE-2026-74902
Immediate Actions Required
- Upgrade all SiYuan installations to version v3.7.4 or later without delay
- Instruct users not to drag, drop, or paste files from untrusted sources into the SiYuan editor until patched
- Inventory endpoints running SiYuan and prioritize workstations belonging to users who handle external file submissions
- Review recent SiYuan asset directories for filenames containing HTML markup and investigate host activity around those events
Patch Information
The maintainers fixed the issue in SiYuan v3.7.4. The patch escapes filenames before they are inserted into HTML through insertAdjacentHTML, closing the DOM sink. Refer to the GitHub Security Advisory GHSA-jf56-jrhq-j2qp for the fix commit and release notes.
Workarounds
- Restrict SiYuan usage to trusted, locally created files until the upgrade is deployed
- Block or quarantine files whose names contain HTML metacharacters at the email gateway or file transfer boundary
- Apply application allowlisting to prevent shell interpreters from being spawned as child processes of the SiYuan binary
- Run SiYuan under a least-privilege user account to limit the impact of command execution
# Example: identify SiYuan installations below the fixed version on Linux hosts
siyuan --version 2>/dev/null | awk '{print $NF}' | \
awk -F. '{ if ($1 < 3 || ($1==3 && ($2 < 7 || ($2==7 && $3 < 4)))) print "vulnerable"; else print "patched" }'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

