VulnWatch by ve1ve2
critical 9.4 EPSS 0.50%

GHSA-v3mg-9v85-fcm7: SiYuan Vulnerable to Remote Code Execution via Malicious Bazaar Package — Marketplace XSS

Source:
OSV.dev
Published:
Fetched:
Updated:
Affects:
github.com/siyuan-note/siyuan/kernel

https://osv.dev/vulnerability/GHSA-v3mg-9v85-fcm7 ↗

osvgono-fix-yet

SiYuan Vulnerable to Remote Code Execution via Malicious Bazaar Package — Marketplace XSS # Remote Code Execution via Malicious Bazaar Package — Marketplace XSS ## Summary SiYuan's Bazaar (community marketplace) renders plugin/theme/template metadata and README content without sanitization. A malicious package author can achieve RCE on any user who browses the Bazaar by: 1. **Package metadata XSS (zero-click):** Package `displayName` and `description` fields are injected directly into HTML via template literals without escaping. Just loading the Bazaar page triggers execution. 2. **README XSS (one-click):** The `renderREADME` function uses `lute.New()` without `SetSanitize(true)`, so raw HTML in the README passes through to `innerHTML` unsanitized. Both vectors execute in Electron's renderer with `nodeIntegration: true` and `contextIsolation: false`, giving full OS command execution. ## Affected Component - **Metadata rendering:** `app/src/config/bazaar.ts:275-277` - **README rendering (backend):** `kernel/bazaar/package.go:635-645` (`renderREADME`) - **README rendering (frontend):** `app/src/config/bazaar.ts:607` (`innerHTML`) - **Electron config:** `app/electron/main.js:422-426` (`nodeIntegration: true`) - **Version:** SiYuan <= 3.5.9 ## Vulnerable Code ### Vector 1: Package metadata — no HTML escaping (bazaar.ts:275-277) ```typescript // Package name injected directly into HTML template — NO escaping ${item.preferredName}${item.preferredName !== item.name ? ` ${item.name} ` : ""} // Package description injected directly — NO escaping ${item.preferredDesc || ""} ``` Note: The `title` attribute uses `escapeAttr()`, but the actual text content does not — inconsistent escaping. ### Vector 2: README rendering — no Lute sanitization (package.go:635-645) ```go func renderREADME(repoURL string, mdData []byte) (ret string, err error) { luteEngine := lute.New() // Fresh Lute instance — SetSanitize NOT called luteEngine.SetSoftBreak2HardBreak(false) luteEngine.SetCodeSyntaxHighlight(false) linkBase := "https://cdn.jsdelivr.net/gh/" + ... luteEngine.SetLinkBase(linkBase) ret = luteEngine.Md2HTML(string(mdData)) // Raw HTML in markdown preserved return } ``` Compare with the SiYuan note renderer in `kernel/util/lute.go:81`: ```go luteEngine.SetSanitize(true) // Notes ARE sanitized — but README is NOT ``` ### Frontend innerHTML injection (bazaar.ts:607) ```typescript fetchPost("/api/bazaar/getBazaarPackageREADME", {...}, response => { mdElement.innerHTML = response.data.html; // Unsanitized HTML from README }); ``` ## Proof of Concept ### Vector 1: Malicious package manifest (zero-click RCE) A malicious `plugin.json` (or `theme.json`, `template.json`): ```json { "name": "helpful-plugin", "displayName": { "default": "Helpful Plugin " }, "descrip Affected: Go:github.com/siyuan-note/siyuan/kernel No fixed version published yet References: https://github.com/siyuan-note/siyuan/security/advisories/GHSA-v3mg-9v85-fcm7 https://nvd.nist.gov/vuln/detail/CVE-2026-56397 https://github.com/siyuan-note/siyuan https://www.vulncheck.com/advisories/siyuan-remote-code-execution-via-malicious-bazaar-package-metadata-and-readme-2

Linked vulnerabilities (2)

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

SiYuan Vulnerable to Remote Code Execution via Malicious Bazaar Package — Marketplace XSS

CWE: CWE-79Aliases: CVE-2026-56397
CVE-2026-56397 critical 9.4 EPSS 0.50% (p43) NVDCVE.orgGHSA
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

SiYuan Vulnerable to Remote Code Execution via Malicious Bazaar Package — Marketplace XSS

CWE: CWE-79Aliases: GHSA-v3mg-9v85-fcm7NVD: Deferred