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: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a stored cross‑site scripting flaw in the CSS snippet rendering function, renderSnippet(). A CSS snippet containing a closing </style> tag terminates the surrounding <style> element when the snippet is inserted via insertAdjacentHTML. The injected closing tag allows arbitrary JavaScript to execute in the renderer, which for Electron desktop applications runs with nodeIntegration enabled. Through this path the attacker can call require('child_process') and spawn shell commands, achieving remote code execution. The flaw is a classic example of CWE‑79 (Cross‑Site Scripting) and, due to improper handling of CSS tags, also relates to CWE‑1188 (CSS Injection: Style Block Breakout). It additionally bypasses the user‑controlled separation of enabledCSS and enabledJS; disabling JavaScript does not prevent the malicious CSS‑based payload from running.

Affected Systems

SiYuan is an open‑source personal knowledge‑management system. All releases prior to 3.7.0, in every platform build that renders CSS snippets with renderSnippet(), are affected. Users who run the Electron desktop edition with default nodeIntegration:true are especially vulnerable. Any workspace that synchronizes a snippet containing the </style> payload and the workspace is shared with users who have write access can propagate the exploit to all devices that pull the workspace.

Risk and Exploitability

The CVSS base score of 9.9 categorizes this flaw as critical. The EPSS score is not available, so the exact exploitation probability cannot be quantified, but the widespread use of SiYuan and the default nodeIntegration setting indicate a high exploitability for attackers who control a synced workspace. Although this vulnerability is not yet in the CISA KEV catalog, its attack vector – the injection of a malicious CSS snippet via a shared workspace – allows automatic execution on any client that pulls the file, elevating the overall risk.

Generated by OpenCVE AI on June 25, 2026 at 00:41 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 25, 2026 at 00:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-mvjr-vv3c-w4qv SiYuan: Stored XSS to RCE via CSS-snippet <style> breakout in renderSnippet()
History

Thu, 25 Jun 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 25 Jun 2026 13:30:00 +0000

Type Values Removed Values Added
First Time appeared Siyuan
Siyuan siyuan
Vendors & Products Siyuan
Siyuan siyuan

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-06-25T15:29:48.982Z

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

Link: CVE-2026-54067

cve-icon Vulnrichment

Updated: 2026-06-25T15:26:15.376Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-06-25T13:15:03Z

Weaknesses
  • CWE-1188

    Initialization of a Resource with an Insecure Default

  • CWE-79

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