Executive brief
SiYuan's community marketplace (Bazaar) fails to sanitize plugin, theme, and template package metadata and README content before displaying it to users. An attacker can inject malicious JavaScript code into package names, descriptions, or README files that executes with full operating system privileges when any user browses the marketplace—even without installing the package. This enables theft of credentials, SSH keys, session cookies, and installation of backdoors or ransomware on affected systems.
Technical details
This vulnerability consists of two cross-site scripting (XSS) vectors in SiYuan's Bazaar marketplace. Vector 1 affects package metadata (displayName and description fields) in plugin.json/theme.json/template.json manifests, which are injected directly into HTML via template literals without HTML escaping in bazaar.ts:275-277, triggering on page load (zero-click). Vector 2 affects README markdown rendering, where the renderREADME function in package.go:635-645 fails to call SetSanitize(true) on the Lute markdown engine, allowing raw HTML to pass through to innerHTML injection in bazaar.ts:607. Both vectors execute in Electron's renderer process with nodeIntegration: true and contextIsolation: false, granting attackers full OS command execution via require('child_process').exec(). No user interaction is required for metadata XSS; README XSS requires a single click to view package details. Affected versions: SiYuan ≤ 3.5.9. No patched version is currently available.
Affected products
- SiYuan SiYuan <= 3.5.9
Timeline
- 2026-03-14: disclosed
- 2026-03-16: advisory