HIGH 7.1

CVE-2026-54070: SiYuan Marketplace README XSS Leads to Admin Workspace Compromise

SiYuan, an open-source personal knowledge management system, contains a cross-site scripting (XSS) vulnerability in how it displays README files from Bazaar marketplace packages. When an administrator views a package in the Settings → Marketplace interface, malicious code embedded in a package README can execute with full administrative privileges in the user's SiYuan workspace. The attack requires no installation—viewing the package listing is sufficient. This affects versions prior to 3.7.0.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.1 HIGH · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Weaknesses (CWE)
CWE-184, CWE-79
Affected products
0 configuration(s)
Published / Modified
2026-06-24 / 2026-06-26

NVD description (verbatim)

SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, renderPackageREADME in kernel/bazaar/readme.go renders a Bazaar package README from Markdown to HTML with the lute engine and SetSanitize(true). The lute sanitizer is an event-handler blocklist: allowAttr rejects only attribute names present in a fixed eventAttrs map copied from the w3schools legacy handler list. That map omits modern event handlers. onpointerover, onpointerdown, onauxclick, onbeforetoggle, onfocusin, onanimationstart, and ontransitionend are not in the list, so the sanitizer passes them through verbatim on any tag. The frontend assigns the rendered HTML to mdElement.innerHTML in app/src/config/bazaar.ts with no client-side DOMPurify on this path, into a normal element in the main document (no iframe, no sandbox). The kernel sends no Content-Security-Policy, X-Frame-Options, or X-Content-Type-Options header on any response, so an inline handler runs when its event fires. The README is rendered when an Administrator opens a package in Settings → Marketplace, after the one-time marketplace trust consent. Install is not required. Result: a third-party Bazaar package author runs JavaScript in the Administrator's authenticated SiYuan origin when the Administrator views and interacts with the package listing, and gains full control of the workspace. This vulnerability is fixed in 3.7.0.

1 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from an incomplete HTML sanitization implementation in the Bazaar package README renderer (kernel/bazaar/readme.go). SiYuan uses the lute Markdown engine with SetSanitize(true), which relies on an event-handler blocklist (allowAttr) derived from a legacy w3schools handler list. This blocklist is missing modern event attributes including onpointerover, onpointerdown, onauxclick, onbeforetoggle, onfocusin, onanimationstart, and ontransitionend. These omitted handlers pass through the sanitizer unfiltered on any HTML tag. The rendered HTML is then assigned directly to mdElement.innerHTML in app/src/config/bazaar.ts without client-side DOMPurify sanitization and without iframe or sandbox isolation. The kernel sends no Content-Security-Policy, X-Frame-Options, or X-Content-Type-Options response headers, allowing inline event handlers to execute when triggered. An authenticated administrator viewing a malicious package README in the marketplace can be exploited when interacting with elements carrying these event handlers.

Business impact

This vulnerability allows unauthorized code execution within an authenticated administrator's SiYuan workspace and can result in complete workspace compromise. An attacker controlling a Bazaar package can exfiltrate sensitive data, modify or delete workspace contents, create new administrative accounts, or establish persistent access. The attack surface includes any administrator who browses the marketplace after giving one-time consent—no explicit package installation is required. For organizations using SiYuan for sensitive documentation, research, or knowledge storage, this represents a critical supply-chain risk vector through the package marketplace.

Affected systems

SiYuan versions prior to 3.7.0 are affected. The vulnerability requires an administrator account and occurs when viewing a package details page in Settings → Marketplace. Open-source deployments, self-hosted instances, and any SiYuan installation with marketplace access are in scope. Users running SiYuan 3.7.0 or later are not affected.

Exploitability

Exploitation requires social engineering or supply-chain trust abuse: a package author (or account takeover of an existing author) publishes or updates a package with a malicious README. When an administrator views that package in the marketplace, the XSS payload fires automatically upon interaction with crafted HTML elements. The CVSS score of 7.1 (HIGH) reflects that user interaction (viewing and interacting with a listing) is required, the attack is network-based, and no special privileges are needed to publish a Bazaar package. The one-time marketplace consent reduces friction but does not add technical complexity. This is not currently listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

Remediation

Upgrade SiYuan to version 3.7.0 or later. The patch hardens sanitization by expanding the event-handler blocklist to include modern event attributes and likely improves downstream handling of rendered HTML. Organizations unable to upgrade immediately should restrict administrative access to the Bazaar marketplace or block outbound connections to the marketplace service. If marketplace discovery is essential, designate a single low-privilege account for package review and restrict administrative browsing of untrusted packages.

Patch guidance

Download and install SiYuan 3.7.0 or any subsequent stable release from the official SiYuan repository or releases page. Verify the release notes confirm the fix for README rendering security. For self-hosted deployments, stop the SiYuan service, back up the data directory, replace binaries, and restart. For packaged installations (Docker, snap, apt, etc.), follow the distribution's standard upgrade process. Test marketplace functionality post-upgrade to confirm the patch does not break legitimate package discovery or display.

Detection guidance

Monitor SiYuan logs for Bazaar marketplace access by administrative accounts, particularly if marketplace API calls precede unusual workspace modifications or data access. If forensic analysis is needed, inspect the browser console and network logs for inline script execution errors or CSP violations (note: SiYuan does not currently send CSP headers, so this will not block attacks in unpatched versions). Review package README HTML rendered in the DOM for presence of event handler attributes (onpointerover, onpointerdown, etc.) on tags that should not carry them. Check administrative account activity logs for API calls to unauthorized endpoints or privilege-escalation actions correlating with marketplace browsing sessions.

Why prioritize this

This vulnerability merits prompt patching because it enables remote code execution in the administrator's context without requiring package installation, affects the trust model of the marketplace ecosystem, and can lead to full workspace compromise. While the CVSS score is 7.1 (HIGH) rather than CRITICAL, the ease of weaponization through a poisoned package and the high value of SiYuan administrative access (which often guards sensitive personal or organizational knowledge) justify prioritization ahead of many other HIGH-severity issues. Organizations with SiYuan deployments storing confidential information should patch within 1–2 weeks.

Risk score, explained

CVSS 7.1 (HIGH) reflects: (1) HIGH confidentiality and integrity impact (workspace compromise, data exfiltration, modification); (2) LOW availability impact (no denial of service mechanism described); (3) Network attack vector (no authentication required beyond the pre-existing trust of marketplace consent); (4) High attack complexity due to user interaction requirement (administrator must view and interact with a malicious package listing); (5) unprivileged attacker capability (any Bazaar package author, or account takeover). The vector CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L accurately captures a remote, high-interaction attack with severe impact on confidentiality and integrity but no cross-scope elevation or sustained DoS.

Frequently asked questions

Does an administrator have to install a malicious package to be exploited?

No. The vulnerability triggers when an administrator simply views a package in Settings → Marketplace. Installation is not required. Once marketplace consent is given (a one-time step), viewing any malicious package README can trigger the XSS.

Can non-administrator users be affected?

The attack requires an authenticated administrator account because only administrators can access Settings → Marketplace. Non-admin users are not at risk from this specific vector, though if there are other XSS paths in SiYuan, separate remediation may be needed.

Why is the event-handler blocklist incomplete?

The sanitizer's blocklist was copied from an outdated w3schools legacy reference and was not updated to include modern event handlers added to the HTML5 specification (like onpointerover, onbeforetoggle, and others). Regular security audits and blocklist maintenance would have caught this.

Will updating SiYuan break my marketplace integrations?

No. Version 3.7.0 fixes the rendering bug and maintains backward compatibility with marketplace discovery and legitimate package display. After patching, administrators can safely browse and install packages without compromised security.

This analysis is based on the CVE description and publicly available information as of the publication date. No exploit code or proof-of-concept has been developed or tested by SEC.co. Patch version numbers (3.7.0) and affected version ranges are taken from the official CVE record; organizations should verify against the vendor's advisory and release notes before deploying patches. This vulnerability is not currently listed in CISA's Known Exploited Vulnerabilities catalog. Security impact may vary depending on SiYuan deployment architecture, marketplace configuration, and organizational access controls. For questions specific to your environment, consult SiYuan's official documentation or support channels. Source: NVD (public-domain), retrieved 2026-08-02. Analysis generated by SEC.co (claude-haiku-4-5).