CVE-2026-34605: Github.com/siyuan note/siyuan/kernel Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-73g7-86qr-jrg3
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2026-34605 is a HIGH (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/siyuan note/siyuan/kernel libraries in the Go ecosystem. The issue involves siyuan vulnerable to reflected xss via svg namespace prefix bypass in sanitizesvg (getdynamicicon, unauthenticated). Remediation is available by upgrading affected packages to version 0.0.0-20260330031106-f09953afc57a.

CVE-2026-34605 at a Glance

CVE Identifier CVE-2026-34605
GHSA Identifier GHSA-73g7-86qr-jrg3
Severity HIGH
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/siyuan note/siyuan/kernel
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.1

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:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-34605

To remediate this vulnerability, upgrade all affected Github.com/siyuan note/siyuan/kernel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/siyuan-note/siyuan/kernel fixed: 0.0.0-20260330031106-f09953afc57a
Upgrade github.com/siyuan-note/siyuan/kernel to 0.0.0-20260330031106-f09953afc57a
Verify Direct and Transitive Dependencies

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/kernel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-34605, inspect your project dependencies for Github.com/siyuan note/siyuan/kernel:

inspect dependencies for github.com/siyuan-note/siyuan/kernel

Analyze the terminal output to locate any version of Github.com/siyuan note/siyuan/kernel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20260330031106-f09953afc57a), 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/kernel, 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

### Summary The `SanitizeSVG` function introduced in v3.6.0 to fix XSS in the unauthenticated `/api/icon/getDynamicIcon` endpoint can be bypassed by using namespace-prefixed element names such as `<x:script xmlns:x="http://www.w3.org/2000/svg">`. The Go HTML5 parser records the element's tag as `"x:script"` rather than `"script"`, so the tag check passes it through. The SVG is served with `Content-Type: image/svg+xml` and no Content Security Policy; when a browser opens the response directly, its XML parser resolves the prefix to the SVG namespace and executes the embedded script. ### Details The `getDynamicIcon` route is registered without authentication: ```go // kernel/server/serve.go ginServer.Handle("GET", "/api/icon/getDynamicIcon", getDynamicIcon) ``` For type 8, the `content` query parameter is inserted directly into an SVG `<text>` element using `fmt.Sprintf` with no HTML encoding: ```go // kernel/api/icon.go:579-584 return fmt.Sprintf(` <svg id="dynamic_icon_type8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> <path d="..."/> <text x="50%%" y="55%%" ...>%s</text> </svg>`, ..., content) ``` `SanitizeSVG` then parses the SVG with `github.com/88250/lute/html` and removes elements whose lowercased tag name matches a fixed list: ```go // kernel/util/misc.go:249-252 tag := strings.ToLower(c.Data) if tag == "script" || tag == "iframe" || tag == "object" || tag == "embed" || tag == "foreignobject" || "animate" == tag || ... { n.RemoveChild(c) ``` The lute HTML parser stores the full qualified name including any namespace prefix in `Node.Data`. A payload like `<x:script xmlns:x="http://www.w3.org/2000/svg">` gets `Data = "x:script"`. The check `tag == "script"` is false, so the element is not removed and survives in the rendered output. Confirmed with the same library version used by SiYuan: ``` html.Parse input: <x:script xmlns:x="http://www.w3.org/2000/svg">alert(1)</x:script> Node.Data result: "x:script" (not "script") Removed by check: false Rendered output: <x:script xmlns:x="http://www.w3.org/2000/svg">alert(1)</x:script> ``` The same bypass works for every element on the blocklist: `x:iframe`, `x:object`, `x:foreignObject`, etc. The fix is to strip the namespace prefix before comparing: ```go localName := tag if i := strings.LastIndex(tag, ":"); i >= 0 { localName = tag[i+1:] } if localName == "script" || localName == "iframe" || ... ``` ### PoC ``` GET /api/icon/getDynamicIcon?type=8&color=red&content=%3C%2Ftext%3E%3Cx%3Ascript%20xmlns%3Ax%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3Ealert%28document.domain%29%3C%2Fx%3Ascript%3E%3Ctext%3E HTTP/1.1 Host: 127.0.0.1:6806 ``` Decoded `content` value: ``` </text><x:script xmlns:x="http://www.w3.org/2000/svg">alert(document.domain)</x:script><text> ``` The response is a valid SVG with the script element intact. Opening the URL directly in a browser triggers the alert, confirming script execution at the SiYuan server origin. ### Impact Any user whose SiYuan instance is reachable over a local network is exposed. An attacker on the same network can craft the URL and share it. When the victim opens it in a browser, JavaScript executes at the `http://<siyuan-host>:6806` origin. Because SiYuan sets `Access-Control-Allow-Origin: *` and the script runs same-origin, it can call any API endpoint using the victim's existing session cookies, including endpoints to read all notes, export data, or modify settings. No authentication or prior access is needed to construct the payload.

CVE-2026-34605 Affected Github.com/siyuan note/siyuan/kernel Versions

1 component(s)
Fixed Versions:
0.0.0-20260330031106-f09953afc57a
Product / Package Ecosystem Affected Versions Fixed Version
github.com/siyuan-note/siyuan/kernel
Go
< 0.0.0-20260330031106-f09953afc57a
0.0.0-20260330031106-f09953afc57a

References

Frequently Asked Questions

What is CVE-2026-34605?
CVE-2026-34605 is a security vulnerability in Github.com/siyuan note/siyuan/kernel involving SiYuan vulnerable to reflected XSS via SVG namespace prefix bypass in SanitizeSVG (getDynamicIcon, unauthenticated) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/siyuan note/siyuan/kernel versions are affected?
Affected versions include releases prior to 0.0.0-20260330031106-f09953afc57a across affected packages: github.com/siyuan-note/siyuan/kernel.
What version fixes CVE-2026-34605?
Upgrading to 0.0.0-20260330031106-f09953afc57a (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/siyuan-note/siyuan/kernel affected?
Yes, github.com/siyuan-note/siyuan/kernel is affected in releases prior to 0.0.0-20260330031106-f09953afc57a. Upgrade your dependency to 0.0.0-20260330031106-f09953afc57a or later.
What is the CVSS score of CVE-2026-34605?
CVE-2026-34605 has a CVSS v3.1 base score of 6.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-34605?
CVE-2026-34605 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check Go dependencies for CVE-2026-34605?
Run the dependency tree command: 'inspect dependencies for github.com/siyuan-note/siyuan/kernel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-73g7-86qr-jrg3",
  "modified" : "2026-04-06T16:40:26Z",
  "published" : "2026-04-01T00:30:01Z",
  "aliases" : [ "CVE-2026-34605" ],
  "summary" : "SiYuan vulnerable to reflected XSS via SVG namespace prefix bypass in SanitizeSVG (getDynamicIcon, unauthenticated)",
  "details" : "### Summary\n\nThe `SanitizeSVG` function introduced in v3.6.0 to fix XSS in the unauthenticated `/api/icon/getDynamicIcon` endpoint can be bypassed by using namespace-prefixed element names such as `<x:script xmlns:x=\"http://www.w3.org/2000/svg\">`. The Go HTML5 parser records the element's tag as `\"x:script\"` rather than `\"script\"`, so the tag check passes it through. The SVG is served with `Content-Type: image/svg+xml` and no Content Security Policy; when a browser opens the response directly, its XML parser resolves the prefix to the SVG namespace and executes the embedded script.\n\n### Details\n\nThe `getDynamicIcon` route is registered without authentication:\n\n```go\n// kernel/server/serve.go\nginServer.Handle(\"GET\", \"/api/icon/getDynamicIcon\", getDynamicIcon)\n```\n\nFor type 8, the `content` query parameter is inserted directly into an SVG `<text>` element using `fmt.Sprintf` with no HTML encoding:\n\n```go\n// kernel/api/icon.go:579-584\nreturn fmt.Sprintf(`\n    <svg id=\"dynamic_icon_type8\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n        <path d=\"...\"/>\n        <text x=\"50%%\" y=\"55%%\" ...>%s</text>\n    </svg>`, ..., content)\n```\n\n`SanitizeSVG` then parses the SVG with `github.com/88250/lute/html` and removes elements whose lowercased tag name matches a fixed list:\n\n```go\n// kernel/util/misc.go:249-252\ntag := strings.ToLower(c.Data)\nif tag == \"script\" || tag == \"iframe\" || tag == \"object\" || tag == \"embed\" ||\n    tag == \"foreignobject\" || \"animate\" == tag || ... {\n    n.RemoveChild(c)\n```\n\nThe lute HTML parser stores the full qualified name including any namespace prefix in `Node.Data`. A payload like `<x:script xmlns:x=\"http://www.w3.org/2000/svg\">` gets `Data = \"x:script\"`. The check `tag == \"script\"` is false, so the element is not removed and survives in the rendered output.\n\nConfirmed with the same library version used by SiYuan:\n\n```\nhtml.Parse input:  <x:script xmlns:x=\"http://www.w3.org/2000/svg\">alert(1)</x:script>\nNode.Data result:  \"x:script\"   (not \"script\")\nRemoved by check:  false\nRendered output:   <x:script xmlns:x=\"http://www.w3.org/2000/svg\">alert(1)</x:script>\n```\n\nThe same bypass works for every element on the blocklist: `x:iframe`, `x:object`, `x:foreignObject`, etc.\n\nThe fix is to strip the namespace prefix before comparing:\n\n```go\nlocalName := tag\nif i := strings.LastIndex(tag, \":\"); i >= 0 {\n    localName = tag[i+1:]\n}\nif localName == \"script\" || localName == \"iframe\" || ...\n```\n\n### PoC\n\n```\nGET /api/icon/getDynamicIcon?type=8&color=red&content=%3C%2Ftext%3E%3Cx%3Ascript%20xmlns%3Ax%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3Ealert%28document.domain%29%3C%2Fx%3Ascript%3E%3Ctext%3E HTTP/1.1\nHost: 127.0.0.1:6806\n```\n\nDecoded `content` value:\n```\n</text><x:script xmlns:x=\"http://www.w3.org/2000/svg\">alert(document.domain)</x:script><text>\n```\n\nThe response is a valid SVG with the script element intact. Opening the URL directly in a browser triggers the alert, confirming script execution at the SiYuan server origin.\n\n### Impact\n\nAny user whose SiYuan instance is reachable over a local network is exposed. An attacker on the same network can craft the URL and share it. When the victim opens it in a browser, JavaScript executes at the `http://<siyuan-host>:6806` origin. Because SiYuan sets `Access-Control-Allow-Origin: *` and the script runs same-origin, it can call any API endpoint using the victim's existing session cookies, including endpoints to read all notes, export data, or modify settings. No authentication or prior access is needed to construct the payload.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/siyuan-note/siyuan/kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20260330031106-f09953afc57a"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-73g7-86qr-jrg3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34605"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/issues/17246"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/siyuan-note/siyuan"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/siyuan-note/siyuan/releases/tag/v3.6.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-01T00:30:01Z",
    "nvd_published_at" : "2026-03-31T22:16:22Z"
  }
}