/

CVE-2026-73052

Severity:

CRITICAL RISK

(9.0)

Stored XSS (CWE-79) in SiYuan Attribute View Menus

CVE-2026-73052

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Stored JavaScript Execution and Potential Desktop Code Execution

Severity:

CRITICAL RISK

(9.0)

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 stores attribute-view field names without HTML escaping and inserts them into sort-menu option elements through innerHTML, allowing stored cross-site scripting. An attacker who can rename a database field may cause arbitrary JavaScript to run when a user opens the sort menu; in the desktop client, enabled Node integration may increase this to operating-system code execution.

Affected context

The vulnerability occurs in SiYuan attribute views when database field names are treated as trusted content while constructing the sort menu. It requires a deployment in which a field name can be changed or otherwise controlled by an attacker, followed by a victim opening the affected menu. The consequences are more severe in desktop environments where Node integration is enabled.

Exploit preconditions

  • Attack surface: SiYuan's attribute-view sort menu
  • Required access: Ability to rename or influence a database field name
  • Trigger point: A user opens the sort menu containing the affected field
  • Why exploitation is possible: Field names are interpolated into HTML

option elements without adequate output encoding, allowing browser-interpreted

markup and script content to reach the rendered interface

Why this happens

The underlying bug is context-inappropriate output handling. User-controlled field names are inserted into an HTML context using innerHTML without escaping or safe DOM construction, so data is interpreted as markup rather than displayed as text. This behavior maps to CWE-79, Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Arbitrary JavaScript may execute in the SiYuan interface
  • Session data or accessible application information could be exposed
  • User actions may be performed within the application's security context
  • The desktop client may permit broader code execution when Node integration is enabled
  • Workspaces or stored content could be modified or corrupted

General mitigation guidance

Mitigation generally focuses on treating database field names as untrusted

display data and preserving a strict separation between content and markup.

Common defensive patterns include:

  • Use text-oriented DOM APIs such as textContent when rendering field names
  • Apply context-appropriate HTML encoding whenever templating is unavoidable
  • Prefer safe DOM construction over string-based innerHTML interpolation
  • Validate and constrain field-name content without relying on validation alone
  • Reduce or disable privileged Node integration in desktop renderer contexts
  • Apply least privilege and isolate renderer capabilities from operating-system APIs
  • Use a restrictive content security policy as defense in depth

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving innerHTML, HTML templates, or string-built option elements
  • Code-review signals where user-controlled names, labels, or metadata enter HTML contexts
  • Tests that render special characters and markup-like input in every field-name display path
  • Policy checks requiring contextual output encoding or text-only DOM APIs
  • Runtime monitoring for unexpected script execution or renderer-to-main-process requests

Automated code-review and SAST tools may help identify unsafe HTML sinks, but

findings should be verified against the actual rendering context.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-g3jx-227v-x2x4
vulncheck.comvulncheck.com/advisories/siyuan-before-stored-xss-via-attribute-view-field-names

Frequently asked

questions

Exploitation is not necessarily direct from an unauthenticated remote request. It

generally requires the attacker to modify or influence a database field name,

after which a victim must open the relevant sort menu.

The required access depends on SiYuan's sharing and permission model. The attacker

needs a way to rename a field or introduce a controlled field name into the

affected database.

Render field names as text using safe DOM APIs, or apply correct HTML escaping

for the exact output context. Avoid inserting untrusted names through innerHTML.

Treat metadata and labels as untrusted input, test all rendering paths with

markup-like values, enforce secure coding rules for HTML sinks, and minimize

privileged capabilities such as desktop Node integration.

Find out what's already
exploitable in your codebase.