SiYuan Vulnerable to Reflected Cross-Site Scripting (XSS) via /api/icon/getDynamicIcon
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.]
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/siyuan-note/siyuan/kernelGo | < 0.0.0-20260118021606-5c0cc375b475 | 0.0.0-20260118021606-5c0cc375b475 |
Affected products
1- Range: dev2.0.17-2, v0.1.0, v0.1.1, …
Patches
15c0cc375b475:lock: Do not execute scripts in serving SVG by default to prevent XSS https://github.com/siyuan-note/siyuan/issues/16844
1 file changed · +4 −0
kernel/api/icon.go+4 −0 modified@@ -164,6 +164,10 @@ func getDynamicIcon(c *gin.Context) { svg = generateTypeOneSVG(color, lang, dateInfo) } + if !model.Conf.Editor.AllowSVGScript { + svg = util.RemoveScriptsInSVG(svg) + } + c.Header("Content-Type", "image/svg+xml") c.Header("Cache-Control", "no-cache") c.Header("Pragma", "no-cache")
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-w836-5gpm-7r93ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-23847ghsaADVISORY
- github.com/siyuan-note/siyuan/commit/5c0cc375b47567e15edd2119066b09bb0aa18777ghsax_refsource_MISCWEB
- github.com/siyuan-note/siyuan/issues/16844ghsax_refsource_MISCWEB
- github.com/siyuan-note/siyuan/security/advisories/GHSA-w836-5gpm-7r93ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.