/

CVE-2026-44586

Severity:

HIGH RISK

(8.3)

XSS in SiYuan Bazaar Marketplace Electron App

CVE-2026-44586

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-94

Impact:

Arbitrary Code Execution via Desktop Application

Severity:

HIGH RISK

(8.3)

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 renders package author metadata from a public feed directly into HTML without proper escaping, leading to stored cross-site scripting (XSS).

In the Electron-based desktop application, this XSS can be escalated to arbitrary code execution on the host because Electron windows are created with nodeIntegration: true and contextIsolation: false.

Affected context

This vulnerability affects SiYuan desktop installations that synchronize with the public Bazaar marketplace feed and display package metadata in an Electron window.

The issue manifests when untrusted author metadata from the Bazaar stage feed is rendered as HTML in the desktop UI without HTML-escaping or sanitization.

The risk is heightened in this context because the Electron configuration exposes Node.js APIs directly to the rendered page, allowing script execution to cross the browser boundary into the host environment.

Exploit preconditions

  • Attack surface: Bazaar marketplace metadata rendered in the SiYuan desktop Electron UI.
  • Required access: Ability to publish or modify package metadata (e.g., author field) in the public Bazaar stage feed; no direct access to a victim's machine is required beyond them using the marketplace.
  • Trigger point: A victim desktop user browsing or loading Bazaar packages whose author metadata is rendered by the application.
  • Why exploitation is possible: The application interpolates untrusted metadata directly into the DOM without escaping or sanitization, and the Electron window is configured with nodeIntegration: true and contextIsolation: false, exposing Node.js APIs to injected JavaScript.

Why this happens

The core issue is the direct rendering of untrusted Bazaar package metadata into HTML without escaping or sanitization, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).

Under normal browser constraints, XSS would be limited to web context impact, but the Electron configuration grants the page full access to Node.js APIs (nodeIntegration: true) and lacks process separation (contextIsolation: false).

This combines the XSS bug with a powerful execution environment, effectively turning a client-side scripting flaw into arbitrary code execution on the user's operating system, with behavior overlapping CWE-94: Improper Control of Generation of Code.

Potential impact

  • Execution of arbitrary JavaScript within the SiYuan desktop application UI.
  • Invocation of Node.js APIs to execute arbitrary code on the host system.
  • Reading, modifying, or exfiltrating local files accessible to the SiYuan process.
  • Installation of additional malware or persistence mechanisms on the affected host.
  • Lateral movement by leveraging host credentials or data obtained through the application.

General mitigation guidance

Effective mitigation focuses on both output encoding and runtime hardening of the Electron environment:

  • Apply strict HTML escaping or use safe templating when rendering any untrusted metadata, including author names and descriptions from remote feeds.
  • Introduce a robust HTML/DOM sanitization layer for all marketplace content, allowing only a minimal safe subset of tags and attributes.
  • Reconfigure Electron windows with nodeIntegration: false by default, and only selectively expose required functionality via preload scripts and controlled IPC.
  • Enable contextIsolation: true so that untrusted page scripts cannot directly access powerful APIs or the Electron internals.
  • Reduce the privileges of the SiYuan desktop process where feasible (filesystem access, execution permissions) to limit damage if a script executes.
  • Treat all remote content (marketplace feeds, plugins, themes) as untrusted and apply uniform security controls, rather than special-case handling.

How teams detect issues like this

Detection generally benefits from analyzing both source code and runtime behavior:

  • Use static analysis rules or linters to flag direct insertion of untrusted data into HTML sinks such as innerHTML, template strings, or dangerous rendering APIs.
  • Add code review checklists focused on Electron-specific risks: verify nodeIntegration, contextIsolation, and preload/IPC usage for any window rendering remote or user-generated content.
  • Employ content security policies (CSP) in web-like contexts to restrict inline scripts and dynamic code sources, and monitor violations for anomalies.
  • Integrate automated dependency and plugin reviews for marketplace submissions, checking metadata fields for suspicious script-like content.
  • Instrument logging around marketplace rendering and error events to spot unusual script execution or access to Node APIs initiated from UI contexts.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-x6wf-w2rg-2gw9

Frequently asked

questions

Yes. An attacker who can control Bazaar package metadata (for example, by publishing a malicious package) can trigger the vulnerability when a user's desktop app loads and renders that metadata, without needing direct network access to the victim.

The attacker primarily needs the ability to inject crafted HTML/JavaScript into the Bazaar marketplace metadata fields that are rendered by the desktop client. No prior access to the victim's machine is required beyond the victim using the vulnerable application and viewing the malicious entry.

The most robust pattern is to combine strict output encoding/sanitization for all untrusted content with secure Electron defaults: disable nodeIntegration, enable contextIsolation, and expose only minimal, vetted APIs via IPC. This defuses the XSS itself and also ensures that any residual scripting bugs do not translate into host-level code execution.

Design UI components so that untrusted data never passes directly into HTML or script contexts, enforce secure-by-default Electron configurations for any window rendering remote or user-supplied content, and institutionalize security reviews that treat marketplace feeds, plugins, and other extensibility mechanisms as high-risk inputs that must be strictly sandboxed and sanitized.

Find out what's already
exploitable in your codebase.