Overview
A critical cross-site scripting (XSS) vulnerability in SiYuan's PDF annotation renderer has been assigned CVE-2026-73041 with a CVSS score of 9.0. The flaw allows attackers to inject malicious markup into PDF annotation fields that execute as scripts in SiYuan's PDF renderer — with full Node.js API access — when a victim opens an annotated PDF document within the application.
This vulnerability is companion to CVE-2026-73043 (template injection RCE) and was disclosed simultaneously, suggesting a broader code audit finding related to output encoding across SiYuan's Electron-based rendering pipeline.
Technical Details
SiYuan allows users to annotate PDF documents embedded within their note workspaces. Annotations are written to disk via the setFileAnnotation endpoint. The vulnerability stems from SiYuan failing to validate or escape annotation field content before writing it to disk and subsequently rendering it in the PDF viewer.
Attack flow:
- An attacker writes a malicious PDF annotation containing script payloads — via the
setFileAnnotationAPI endpoint or by directly manipulating annotation data shared through workspace sync. - The annotation is stored on disk without sanitization.
- When a victim opens the annotated PDF in SiYuan, the embedded annotation is rendered in SiYuan's PDF viewer component — an Electron webview context.
- The injected script executes with full Node.js access (via Electron's
nodeIntegrationor equivalent IPC bridge), enabling arbitrary file system operations, process execution, and data exfiltration from the victim's machine.
Why Node.js access matters:
Unlike browser-based XSS, Electron-based XSS in a nodeIntegration-enabled context is effectively equivalent to native code execution. An attacker can read SSH keys, steal secrets from environment variables, exfiltrate the entire SiYuan workspace, or install persistent malware — all triggered by the victim simply opening a shared annotated PDF.
Relationship to CVE-2026-73043
Both CVE-2026-73041 and CVE-2026-73043 affect SiYuan versions before v3.7.4 and share the root cause: rendered content from user-controlled inputs (template blocks, annotation fields) is inserted into Electron renderer contexts without sanitization. The v3.7.4 patch addresses both attack surfaces.
Affected Versions
All SiYuan releases prior to v3.7.4 are vulnerable. The CVE was published August 15, 2026.
Mitigation
- Upgrade to SiYuan v3.7.4 or later immediately. Both CVE-2026-73041 and CVE-2026-73043 are patched in this release.
- Until patched, do not open annotated PDFs received from untrusted parties or synced from untrusted workspaces.
- Organizations using SiYuan for team knowledge management should audit annotation data on shared workspaces for suspicious content.
- If workspace sync is in use, restrict who can contribute annotations until all participants have upgraded.