Executive brief
SiYuan is an open-source personal knowledge management system. A security flaw in its marketplace component allows a malicious package to execute unauthorized commands on a user's computer. If a user simply views a specially crafted package in the marketplace, an attacker could gain full control over the user's system, potentially leading to data theft or complete service disruption.
Technical details
SiYuan prior to version 3.7.0 is vulnerable to a stored XSS that escalates to RCE due to an incomplete fix for a previous vulnerability. The application serializes untrusted package fields (name, version, author, description) into the 'data-obj' HTML attribute of marketplace cards using JSON.stringify(). Because the attribute is single-quoted and JSON.stringify() does not escape single quotes, an attacker can break out of the attribute to inject arbitrary HTML. In the Electron-based desktop client, the main window runs with 'nodeIntegration: true' and 'contextIsolation: false', allowing the injected script to execute arbitrary OS commands via Node.js APIs. This can be triggered by a user simply browsing the marketplace or viewing a malicious local package. The issue is fixed in version 3.7.0.
Affected products
- siyuan-note SiYuan < 3.7.0
Timeline
- 2026-06-14: advisory: GitHub Security Advisory published
- 2026-06-24: disclosed: CVE published to NVD