SiYuan Bazaar Marketplace Stored XSS Leads to Electron RCE
SiYuan's Bazaar marketplace is vulnerable to stored cross-site scripting (XSS) via unescaped package metadata, leading to arbitrary OS command execution in the desktop Electron client.
SiYuan’s Bazaar (community marketplace) renders the name and version fields of a package’s plugin.json into the Settings → Marketplace UI without HTML escaping, leading to a stored XSS vulnerability. The kernel-side helper sanitizePackageDisplayStrings in kernel/bazaar/package.go HTML-escapes only Author, DisplayName, and Description — Name and Version flow through to the renderer raw. Because the desktop client is built on Electron with nodeIntegration: true, contextIsolation: false, and webSecurity: false, the resulting cross-site scripting executes in a renderer with full access to Node.js APIs, escalating directly to arbitrary OS command execution under the victim’s account. The trigger requires merely opening Settings → Marketplace → Downloaded → Plugins. This vulnerability affects SiYuan kernel versions up to and including 0.0.0-20260421031503-96dfe0bea474.
Attack Chain
- An attacker crafts a malicious plugin manifest (
plugin.json) containing a payload in thenameorversionfields, such as<img src=x onerror="require('child_process').exec('...')">. - The attacker submits the malicious plugin manifest to the SiYuan Bazaar marketplace, or places it in the local plugins directory.
- The SiYuan kernel retrieves and stores the plugin manifest without properly sanitizing the
nameandversionfields. - A user opens the SiYuan application and navigates to Settings → Marketplace → Downloaded → Plugins.
- The SiYuan frontend fetches the plugin metadata, including the unsanitized
nameandversionfields, from the backend. - The frontend substitutes the
nameorversionfields into the HTML of the marketplace card list via${item.preferredName},${data.name}, orv${data.version}. - The browser parses the malicious HTML, triggering the
onerrorevent of the injected<img>tag. - The
onerrorhandler executesrequire('child_process').exec(...), leading to arbitrary OS command execution under the user’s account.
Impact
Successful exploitation results in arbitrary OS command execution on the victim’s machine with the privileges of the user running the SiYuan application. This allows attackers to steal sensitive information, install malware, or perform other malicious actions. The vulnerability is triggered by simply viewing the marketplace listing, making it a zero-click exploit. The injected payload is visually undetectable due to the use of display:none style, making the attack stealthy. The Bazaar marketplace serves as a low-friction delivery channel.
Recommendation
- Deploy the Sigma rule
Detect SiYuan Bazaar XSS via Malicious Plugin Nameto detect exploitation attempts by monitoring for img tags with onerror attributes in bazaar package names. - Deploy the Sigma rule
Detect SiYuan Bazaar XSS via Malicious Plugin Versionto detect exploitation attempts by monitoring for img tags with onerror attributes in bazaar package versions. - Upgrade to a patched version of SiYuan that includes proper HTML escaping of package metadata to address CVE-2026-45375.
- Implement the suggested fix by extending the kernel allowlist in
kernel/bazaar/package.goto escape theName,Version, andKeywordsfields. - Apply the secondary fix by calling
sanitizePackageDisplayStringsfromkernel/bazaar/bazaar.go:48to ensure consistent sanitization. - Harden the Electron renderer by enabling
contextIsolation: trueinapp/electron/main.jsto limit the impact of future XSS vulnerabilities.
Detection coverage 2
Detect SiYuan Bazaar XSS via Malicious Plugin Name
highDetects CVE-2026-45375 exploitation — XSS attempt via malicious img tag in SiYuan Bazaar plugin name field
Detect SiYuan Bazaar XSS via Malicious Plugin Version
highDetects CVE-2026-45375 exploitation — XSS attempt via malicious img tag in SiYuan Bazaar plugin version field
Detection queries are available on the platform. Get full rules →