/

CVE-2026-75916

Severity:

HIGH RISK

(8.6)

Stored XSS (CWE-79) in SiYuan Block Autocomplete Popup

CVE-2026-75916

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.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 through version 3.7.3 contains a cross-site scripting vulnerability in the block-reference autocomplete popup. Unsanitized block metadata can execute script when a victim searches for a crafted block, and SiYuan's Electron configuration may allow that script to invoke operating-system commands.

Affected context

The vulnerability occurs in SiYuan's Electron-based editor when block-reference autocomplete results are generated. It requires a block whose name, alias, or memo contains attacker-controlled markup and a victim who opens the autocomplete popup by entering a block-reference search. The risk is greater when Electron security controls such as context isolation and content security policy are disabled.

Exploit preconditions

  • Attack surface: The block-reference autocomplete hint popup in the SiYuan editor
  • Required access: Ability to create or modify a block's name, alias, or memo metadata
  • Trigger point: Rendering autocomplete results after a victim enters a block-reference search
  • Why exploitation is possible: Metadata is concatenated into HTML without context-appropriate escaping, allowing browser script execution; permissive Electron settings may expose privileged Node.js capabilities

Why this happens

The issue results from inserting attacker-influenced block metadata directly into an HTML string without output encoding or safe DOM construction. This is a reflected or stored-style cross-site scripting pattern, depending on how the crafted metadata is persisted and displayed, and maps to CWE-79: Improper Neutralization of Input During Web Page Generation. The impact is amplified because the affected Electron renderer may run with Node.js integration enabled, context isolation disabled, and no effective content security policy.

Potential impact

  • Arbitrary script execution in a victim's SiYuan renderer
  • Access to sensitive application or local user data
  • Execution of operating-system commands through exposed Node.js capabilities
  • Compromise of the user's workstation account
  • Modification, deletion, or exfiltration of accessible files

General mitigation guidance

Mitigation generally focuses on treating block metadata as untrusted content and maintaining strong Electron renderer boundaries.

Common defensive patterns include:

  • Escaping metadata for the exact HTML context, or constructing DOM nodes through safe text APIs
  • Separating data from markup and avoiding string-based HTML generation for autocomplete results
  • Disabling Node.js integration in renderer windows and enabling context isolation
  • Applying a restrictive content security policy where compatible with application functionality
  • Validating and constraining metadata at input boundaries without relying on validation as a substitute for output encoding
  • Limiting renderer privileges and exposing only narrowly scoped, protected APIs through a preload layer

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for unsanitized string concatenation passed to HTML-rendering APIs
  • Code review checks covering innerHTML, template construction, and dynamic markup generation
  • Electron configuration reviews for Node.js integration, context isolation, preload exposure, and CSP settings
  • Dynamic testing with harmless encoded markers in block metadata to verify correct text rendering
  • Policy enforcement that requires contextual output encoding and secure renderer defaults

Automated security review tools may help flag dangerous DOM sinks and permissive Electron settings, but findings should be validated against the application's rendering flow.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-5prr-vgxq-69g9
vulncheck.comvulncheck.com/advisories/siyuan-xss-to-rce-via-unescaped-block-metadata-in-hint-popup

Frequently asked

questions

Exploitation is generally dependent on the attacker's ability to place or modify block metadata and on a victim opening a matching autocomplete result. Whether that access is remote depends on the deployment's synchronization, collaboration, and access controls.

Usually, some authenticated or otherwise authorized ability to edit block metadata is required. The exact requirement depends on how SiYuan content is shared and synchronized.

Treat block metadata as untrusted, render it as text or contextually encode it before insertion into HTML, and use secure Electron defaults that prevent renderer scripts from directly accessing Node.js.

Combine output encoding, safe DOM construction, strict content security policy, isolated Electron renderers, least-privilege preload APIs, and code review rules for dynamic HTML generation.

Find out what's already
exploitable in your codebase.