Executive brief
SiYuan is a popular open-source note-taking and personal knowledge management application. An attacker can inject malicious HTML and scripts by creating a bazaar package (plugin/theme marketplace) with an encoded script in the package name. When legitimate users uninstall the package or unlock an encrypted notebook, the script executes in their browser with full access to their SiYuan data and session, enabling account compromise and data theft.
Technical details
This is a stored cross-site scripting (XSS) vulnerability caused by unsanitized string interpolation in the confirmDialog() function. Unescaped package names and notebook names from external sources (bazaar packages and encrypted notebook titles) are concatenated directly into HTML strings that are then assigned to the DOM via innerHTML. The vulnerable code paths include uninstall confirmation dialogs in app/src/config/bazaar.ts and encrypted notebook unlock dialogs in app/src/util/mount.ts. An attacker can craft a bazaar package with HTML/JavaScript payloads in the name field; when a victim interacts with this package (uninstalling or unlocking), the payload executes in their browser context. The vulnerability was patched in v3.8.1; all versions before 3.8.1 are affected.
Affected products
- SiYuan SiYuan before v3.8.1
Timeline
- 2026-08-15: disclosed
- 2026-08-30: patched: v3.8.1 released with fix