/

CVE-2026-55570

Severity:

CRITICAL RISK

(9.0)

DOM XSS (CWE-79) in SiYuan Marketplace Cards

CVE-2026-55570

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-94, CWE-116

Impact:

Arbitrary Code Execution via DOM XSS

Severity:

CRITICAL RISK

(9.0)

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 marketplace cards serialize untrusted package metadata directly into a data-obj HTML attribute without escaping, allowing injected markup when names contain single quotes.

In the desktop client, where nodeIntegration is enabled and contextIsolation is disabled, this DOM XSS can escalate to arbitrary OS command execution.

Affected context

The vulnerability occurs in SiYuan's marketplace UI when package fields such as name, version, author, and description are serialized into a data-obj attribute using JSON.stringify() without HTML escaping.

It is relevant in deployments where unreviewed or third-party packages can appear in the marketplace and the desktop client runs with nodeIntegration enabled and contextIsolation disabled, which turns script injection into an OS-level code execution risk.

Exploit preconditions

  • Attack surface: SiYuan marketplace card rendering in the desktop application and any embedded browser context that reflects package metadata.
  • Required access: Ability to publish or influence marketplace package metadata (e.g., package name) so that it is rendered by a user's client.
  • Trigger point: User visits or refreshes the marketplace view where vulnerable cards are rendered and the crafted metadata is embedded into the data-obj attribute.
  • Why exploitation is possible: Unescaped single quotes in JSON.stringify() output allow the attacker-controlled field to break out of the single-quoted HTML attribute and inject arbitrary HTML, which the browser interprets as part of the page DOM. In the desktop client configuration, injected scripts can access Node APIs and execute OS commands.

Why this happens

The underlying bug is a failure to apply proper output encoding to untrusted data before inserting it into HTML attributes, mapping directly to CWE-79 (Improper Neutralization of Input During Web Page Generation).

Using JSON.stringify() as a serialization helper does not provide HTML context-aware escaping, so characters like single quotes, angle brackets, and greater-than signs remain intact and can terminate attributes or start new HTML elements.

In the desktop Electron-based client, permissive settings such as nodeIntegration: true and contextIsolation: false further extend the impact from client-side script injection to CWE-94-style arbitrary code execution, because injected scripts can interact with Node.js and the underlying operating system.

Potential impact

  • Attackers may inject arbitrary HTML and JavaScript into the marketplace view.
  • Malicious scripts could execute OS commands via Node.js APIs in the desktop client.
  • Users' local data and files can be read, modified, or exfiltrated by injected code.
  • The application's integrity may be compromised, enabling further persistence or payload delivery.
  • Attackers could impersonate UI elements, phish credentials, or mislead users within the app.

General mitigation guidance

Mitigation centers on treating all marketplace metadata as untrusted and applying strict context-aware output encoding before inserting values into HTML attributes or the DOM.

Common defensive patterns include:

  • Encoding special characters for HTML and attribute contexts (e.g., escaping quotes, angle brackets, and ampersands) before serialization.
  • Avoiding direct string concatenation for building HTML; instead, use safe DOM APIs that separate data from markup.
  • Reducing the privileges of browser environments by disabling nodeIntegration and enabling contextIsolation to prevent script access to OS-level capabilities.
  • Applying least-privilege principles for any bridge APIs exposed to renderer processes, ensuring that even if script injection occurs, sensitive operations remain inaccessible.
  • Treating marketplace content as external input and layering validation, sanitization, and policy checks on submission and rendering.

How teams detect issues like this

Effective detection strategies focus on identifying unescaped user-controlled data in HTML generation paths and overly permissive runtime configurations.

Approaches may include:

  • Static analysis rules that flag direct interpolation of untrusted variables into HTML attributes or innerHTML without context-aware encoding.
  • Code review practices that scrutinize any uses of JSON.stringify() or template literals in UI rendering, especially when combined with single-quoted attributes.
  • Configuration audits of Electron or webview-based clients to detect nodeIntegration: true, contextIsolation: false, or similar high-risk settings.
  • Automated security testing (e.g., DOM XSS probes) against marketplace views to detect reflection of crafted metadata in the rendered DOM.
  • Policy enforcement in CI that requires safe encoding utilities and rejects patterns known to lead to XSS in templating or front-end code.

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-x88j-wgpr-h22x

Frequently asked

questions

Exploitability depends on whether attackers can get malicious package metadata displayed in a user's marketplace view. In environments where users can access community or untrusted packages, a single crafted package can reach many clients.

An attacker needs the ability to influence the fields used in marketplace cards—typically by publishing or modifying a package whose name or other metadata includes malicious content. Direct access to the victim's machine is not required if the victim loads the compromised marketplace view.

The safest approach is to apply strict, context-aware HTML attribute encoding to all untrusted fields before rendering, and to eliminate reliance on insecure configuration options such as nodeIntegration: true and contextIsolation: false. Separating data from markup via safe DOM APIs further reduces risk.

Prevention involves adopting a secure templating strategy, mandating output encoding libraries for any user-supplied data, and enforcing hardened runtime configurations for desktop and web clients. Regular security reviews, automated checks for XSS-prone patterns, and secure defaults for Electron or browser shells help reduce recurrence.

Find out what's already
exploitable in your codebase.