/

CVE-2026-56395

Severity:

CRITICAL RISK

(9.6)

Stored XSS (CWE-79) in SiYuan Bazaar Marketplace

CVE-2026-56395

Deferred

Vulnerability type

Category:

Cross-Site Scripting (Stored XSS)

CWE:

CWE-79

Impact:

Remote Code Execution via Stored XSS

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SiYuan's Bazaar marketplace fails to sanitize package metadata and README content, enabling stored cross-site scripting in the desktop client.

Malicious package authors can inject arbitrary HTML and JavaScript that, when viewed by users, executes with Electron's nodeIntegration privileges, potentially leading to remote code execution on their systems.

Affected context

This vulnerability occurs in the SiYuan application when users browse packages in the Bazaar marketplace.

It manifests specifically where untrusted package metadata (such as displayName, description, and README fields) is rendered without proper HTML or script sanitization.

The risk is heightened in environments where the Electron shell is configured with nodeIntegration enabled, allowing web content to interact directly with the underlying OS APIs.

Exploit preconditions

  • Attack surface: SiYuan Bazaar marketplace views within the Electron-based desktop client
  • Required access: Ability for an attacker to publish or modify a package with crafted metadata or README content
  • Trigger point: Any user browsing, viewing details, or reading README content of the malicious package within the Bazaar
  • Why exploitation is possible: User-supplied HTML and JavaScript from package metadata is rendered in a privileged web context without sanitization, and nodeIntegration exposes OS-level capabilities to the injected script

Why this happens

The core issue is the direct rendering of untrusted content in a privileged web view without adequate sanitization or context isolation.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where user-controlled data is inserted into an HTML/JavaScript context and executed in the victim's browser or webview.

In this case, the use of Electron with nodeIntegration further amplifies the impact by allowing injected scripts to access Node.js APIs and execute OS-level commands, converting a typical XSS into a full remote code execution vector.

Potential impact

  • Malicious JavaScript can execute whenever users view a crafted Bazaar package
  • Attackers may execute arbitrary OS commands through Node.js APIs exposed by nodeIntegration
  • User data within SiYuan can be accessed, modified, or exfiltrated
  • Compromised systems may be used as a foothold for further lateral movement
  • Persistent compromise of a user's environment through installation of additional malware or backdoors

General mitigation guidance

Effective mitigation focuses on breaking the chain between untrusted content and privileged execution.

Common defensive patterns include:

  • Applying robust HTML and script sanitization to all user-supplied package metadata and README content before rendering
  • Using context-aware output encoding for dynamic content inserted into the DOM
  • Disabling or strictly limiting nodeIntegration and other high-privilege webview features, favoring isolated, sandboxed renderers
  • Rendering untrusted marketplace content in a low-privilege, isolated process or browser context with no direct OS access
  • Adopting a default-deny model for active content, enabling scripts only where strictly necessary and from trusted sources

How teams detect issues like this

Organizations can detect and reduce this class of issue through:

  • Static analysis rules that flag direct insertion of untrusted data into HTML, innerHTML, or templating contexts without sanitization
  • Code review checklists focusing on any rendering of marketplace or user-supplied content in Electron/webview components
  • Security linters and policies that highlight use of nodeIntegration, remote module, or other high-risk Electron settings in combination with dynamic content
  • Automated tests or fuzzing that inject benign script markers into package metadata to detect unexpected script execution paths

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-v3mg-9v85-fcm7
vulncheck.comvulncheck.com/advisories/siyuan-remote-code-execution-via-malicious-bazaar-package-metadata-and-readme

Frequently asked

questions

Yes. An attacker can host a malicious package in the Bazaar marketplace, and any user who views that package's details or README triggers the injected script without additional interaction.

The attacker primarily needs the ability to publish or modify a Bazaar package's metadata or README content.

They do not require direct access to the victim's machine; exploitation happens when the victim's SiYuan client loads the malicious package information.

The most robust pattern is to treat all marketplace content as untrusted, rigorously sanitize and encode it before rendering, and ensure it is displayed in a context that does not expose Node.js or OS-level APIs.

Disabling nodeIntegration for views that render untrusted content significantly reduces the maximum impact.

Establish a secure-by-default configuration for Electron/webview components, including disabled nodeIntegration and restricted capabilities for untrusted content.

Combine this with mandatory output encoding, centralized sanitization utilities, and security-focused code review policies that pay special attention to any new rendering of user-supplied data.

Find out what's already
exploitable in your codebase.