CVE-2026-23852 Overview
CVE-2026-23852 is a stored Cross-Site Scripting (XSS) vulnerability in SiYuan, a personal knowledge management system. This vulnerability allows an attacker to inject arbitrary HTML attributes into the icon attribute of a block via the /api/attr/setBlockAttrs API. The malicious payload is later rendered in the dynamic icon feature without proper sanitization, leading to stored XSS and, in the desktop environment, potential remote code execution (RCE).
This vulnerability represents a bypass of a previous security fix for issue #15970, which also addressed XSS to RCE via dynamic icons. The incomplete nature of the original patch allowed attackers to find alternative injection vectors.
Critical Impact
Attackers can achieve stored XSS that persists across sessions, and in Electron-based desktop environments, escalate to full remote code execution, potentially compromising the entire system.
Affected Products
- SiYuan versions prior to 3.5.4
- SiYuan Desktop Application (Electron-based) versions prior to 3.5.4
- SiYuan Web Application versions prior to 3.5.4
Discovery Timeline
- 2026-01-19 - CVE-2026-23852 published to NVD
- 2026-01-19 - Last updated in NVD database
Technical Details for CVE-2026-23852
Vulnerability Analysis
The vulnerability exists in the block attribute handling mechanism of SiYuan's API layer. When users interact with the /api/attr/setBlockAttrs endpoint, the application accepts user-controlled input for block attributes including the icon parameter. The dynamic icon feature subsequently renders these attributes without adequate sanitization, creating an injection point for malicious HTML attributes.
The root issue stems from improper input validation (CWE-94: Improper Control of Generation of Code) where the application fails to properly escape or validate attribute values before rendering them in the DOM context. This is particularly dangerous in Electron-based desktop applications where JavaScript execution can break out of the browser sandbox and interact with the underlying operating system.
Root Cause
The vulnerability originates from incomplete input sanitization in the dynamic icon rendering component. The previous fix for issue #15970 addressed specific XSS vectors but did not comprehensively cover all attribute injection scenarios. The icon attribute value is directly interpolated into the rendered HTML without proper encoding, allowing attackers to break out of the attribute context and inject additional HTML attributes or event handlers.
Attack Vector
The attack is network-based and requires user interaction. An attacker can exploit this vulnerability by:
- Crafting a malicious payload containing arbitrary HTML attributes
- Sending the payload via the /api/attr/setBlockAttrs API to set a block's icon attribute
- Waiting for a victim to view or interact with the block containing the malicious icon
- When rendered, the injected attributes execute in the victim's browser context
- In desktop environments, the attacker can leverage Electron's Node.js integration to execute system commands
The stored nature of this XSS means the malicious payload persists in the application's data store and executes whenever the affected content is rendered, making it particularly dangerous for shared knowledge bases.
Detection Methods for CVE-2026-23852
Indicators of Compromise
- Unusual API calls to /api/attr/setBlockAttrs endpoint with encoded or obfuscated payloads in the icon parameter
- Block attributes containing unexpected HTML event handlers such as onerror, onload, onmouseover, or onfocus
- Evidence of JavaScript execution in application logs indicating DOM manipulation or external resource loading
- System command execution traces originating from the SiYuan desktop application process
Detection Strategies
- Monitor network traffic for suspicious POST requests to the /api/attr/setBlockAttrs endpoint containing special characters or script tags
- Implement Content Security Policy (CSP) headers to detect and prevent inline script execution
- Review application audit logs for attribute modifications containing potential XSS payloads
- Deploy endpoint detection rules to identify anomalous child process spawning from Electron-based applications
Monitoring Recommendations
- Enable verbose logging for all API attribute modification operations
- Configure web application firewalls (WAF) to inspect and block requests containing XSS patterns in JSON payloads
- Monitor for unusual network connections or process creation originating from the SiYuan application
- Establish baseline behavior for the application and alert on deviations such as unexpected script execution
How to Mitigate CVE-2026-23852
Immediate Actions Required
- Upgrade SiYuan to version 3.5.4 or later immediately
- Audit existing blocks for suspicious icon attribute values that may contain injected HTML
- Restrict network access to the SiYuan API for untrusted users until patching is complete
- Consider disabling the dynamic icon feature temporarily if upgrade is not immediately possible
Patch Information
The SiYuan development team has released version 3.5.4 which contains an updated fix for this vulnerability. The patch is available in the GitHub commit. Additional details can be found in the GitHub Security Advisory GHSA-7c6g-g2hx-23vv.
The fix implements comprehensive input sanitization for block attributes, ensuring that user-controlled values cannot escape the attribute context and inject malicious code.
Workarounds
- Implement network-level filtering to block requests to /api/attr/setBlockAttrs containing suspicious patterns
- Deploy a reverse proxy with request inspection to sanitize incoming API payloads before they reach the application
- Limit API access to authenticated and trusted users only using network segmentation or firewall rules
- Disable the dynamic icon feature if supported by the application configuration
# Example: Restrict API access using iptables (Linux)
# Allow only trusted IP to access SiYuan API
iptables -A INPUT -p tcp --dport 6806 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 6806 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


