Description
SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, CSS snippet body containing </style> breaks out of its surrounding <style> tag when renderSnippet() interpolates it via insertAdjacentHTML. A payload like runs arbitrary JavaScript in the renderer. On Electron desktop builds the renderer runs with nodeIntegration:true, so require('child_process') is reachable from the injected handler and the XSS chains to host RCE. Snippets sync via the workspace repository, so an attacker with write access to any synced workspace plants the payload once and it fires on every device that pulls. The bug also bypasses the user's enabledCSS / enabledJS separation. A user who turned enabledJS off was making a deliberate call not to run untrusted JavaScript; the CSS path runs it anyway. This vulnerability is fixed in 3.7.0.
Published: 2026-06-24
Score: 9.9 Critical
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a stored cross‑site scripting flaw in SiYuan's CSS snippet rendering that allows an attacker to inject a payload containing a closing </style> tag, terminate the surrounding style element, and insert arbitrary JavaScript. The injected code runs in the Electron renderer process where nodeIntegration is enabled, enabling the attacker to call child_process modules and execute shell commands, thereby granting full remote code execution. This flaw also bypasses the user’s preference to disable JavaScript, allowing the CSS path to run even when JS is turned off, and it propagates to all devices that pull from a synced workspace once the attacker with write access plants the payload.

Affected Systems

The issue affects SiYuan personal knowledge management system releases before version 3.7.0, specifically all builds that use renderSnippet() to render CSS snippets in Electron desktop applications. Any user with write access to a synced workspace can upload the malicious snippet, making the flaw consequential for all participants who share that workspace.

Risk and Exploitability

The CVSS score of 9.9 marks this flaw as critical, and while EPSS is not available, the widespread use of SiYuan and the default node integration in Electron mean the exploitability is high. The flaw is not yet listed in the CISA KEV catalog, but the attack vector is local via a synced workspace; any device syncing the malicious snippet will execute the payload automatically, making the risk very high.

Generated by OpenCVE AI on June 24, 2026 at 22:56 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade SiYuan to version 3.7.0 or later, where the CSS snippet rendering flaw is fixed.
  • If an upgrade is not immediately possible, remove any malicious or untrusted CSS snippets from synced workspaces and revoke write access from users who may have introduced the payload.
  • As a temporary measure, disable CSS snippet rendering or disable node integration in the Electron configuration until a patch can be applied.

Generated by OpenCVE AI on June 24, 2026 at 22:56 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 24 Jun 2026 21:45:00 +0000

Type Values Removed Values Added
Description SiYuan is an open-source personal knowledge management system. Prior to 3.7.0, CSS snippet body containing </style> breaks out of its surrounding <style> tag when renderSnippet() interpolates it via insertAdjacentHTML. A payload like runs arbitrary JavaScript in the renderer. On Electron desktop builds the renderer runs with nodeIntegration:true, so require('child_process') is reachable from the injected handler and the XSS chains to host RCE. Snippets sync via the workspace repository, so an attacker with write access to any synced workspace plants the payload once and it fires on every device that pulls. The bug also bypasses the user's enabledCSS / enabledJS separation. A user who turned enabledJS off was making a deliberate call not to run untrusted JavaScript; the CSS path runs it anyway. This vulnerability is fixed in 3.7.0.
Title SiYuan: Stored XSS to RCE via CSS-snippet <style> breakout in renderSnippet()
Weaknesses CWE-1188
CWE-79
References
Metrics cvssV3_1

{'score': 9.9, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-06-24T21:14:38.173Z

Reserved: 2026-06-11T18:24:35.097Z

Link: CVE-2026-54067

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-24T23:00:06Z

Weaknesses
  • CWE-1188

    Initialization of a Resource with an Insecure Default

  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')