CVE-2026-32749 Overview
CVE-2026-32749 is a path traversal vulnerability (CWE-22) in SiYuan, a personal knowledge management system. In versions 3.6.0 and below, the POST /api/import/importSY and POST /api/import/importZipMd endpoints write uploaded archives to a path derived from the multipart filename field without proper sanitization. This allows an authenticated admin user to write files to arbitrary locations outside the intended temp directory, including system paths that can enable remote code execution (RCE).
Critical Impact
Authenticated administrators can exploit path traversal to achieve arbitrary file write, potentially leading to remote code execution, data destruction, and full container compromise in Docker environments running as root.
Affected Products
- SiYuan version 3.6.0 and below
- SiYuan Docker containers (especially those running as root)
- SiYuan self-hosted installations
Discovery Timeline
- 2026-03-19 - CVE CVE-2026-32749 published to NVD
- 2026-03-19 - Last updated in NVD database
Technical Details for CVE-2026-32749
Vulnerability Analysis
The vulnerability exists in SiYuan's import functionality, specifically in the kernel/api/import.go and kernel/api/sync.go files. When processing file uploads via the import API endpoints, the application directly concatenates the user-supplied filename from the multipart form data with the import directory path without validating whether the resulting path stays within the intended directory boundaries.
An attacker with administrative privileges can craft a malicious filename containing path traversal sequences (such as ../) to escape the designated import directory and write files to arbitrary locations on the file system. This is particularly dangerous in Docker environments where the application commonly runs as root, as successful exploitation grants full container compromise.
Root Cause
The root cause is improper input validation of the multipart filename field in file upload handlers. The vulnerable code constructs the file write path by directly joining the import directory with the unsanitized filename:
writePath := filepath.Join(util.TempDir, "import", file.Filename)
This allows filenames containing ../ sequences to traverse outside the intended directory boundary, violating the expected security constraint that uploaded files should only be written within the designated import directory.
Attack Vector
The attack requires network access and administrative privileges to the SiYuan application. An attacker can exploit this vulnerability by:
- Authenticating to the SiYuan instance with admin credentials
- Crafting a multipart form request to /api/import/importSY or /api/import/importZipMd
- Setting the filename field to include path traversal sequences (e.g., ../../../etc/cron.d/malicious)
- Uploading a malicious payload that will be written to the target location
The following patch demonstrates the fix applied in version 3.6.1:
writePath := filepath.Join(importDir, file.Filename)
if !util.IsSubPath(importDir, writePath) {
logging.LogErrorf("import path [%s] is not sub path of import dir [%s]", writePath, importDir)
ret.Code = -1
ret.Msg = "import path is not sub path of import dir"
return
}
defer os.RemoveAll(writePath)
writer, err := os.OpenFile(writePath, os.O_RDWR|os.O_CREATE, 0644)
Source: GitHub Commit Changes
Detection Methods for CVE-2026-32749
Indicators of Compromise
- Unusual file creation or modification in system directories outside the SiYuan workspace
- HTTP POST requests to /api/import/importSY or /api/import/importZipMd with filenames containing ../ sequences
- Unexpected cron jobs, startup scripts, or configuration files appearing on the system
- Log entries showing import operations with suspicious file paths
Detection Strategies
- Monitor web server access logs for POST requests to import endpoints containing path traversal patterns in multipart data
- Implement file integrity monitoring on critical system directories to detect unauthorized file writes
- Deploy application-layer firewalls (WAF) with rules to detect and block path traversal sequences in uploaded filenames
- Review SiYuan application logs for import path validation errors introduced in version 3.6.1
Monitoring Recommendations
- Enable verbose logging for SiYuan import operations to capture filename parameters
- Set up alerts for any file write operations outside the designated SiYuan workspace directories
- Monitor container file system changes if running SiYuan in Docker environments
- Implement network monitoring for unusual API activity from administrative sessions
How to Mitigate CVE-2026-32749
Immediate Actions Required
- Upgrade SiYuan to version 3.6.1 or later immediately
- Audit recent import activity logs for any suspicious filenames containing path traversal sequences
- If running in Docker, verify the container is not running as root and implement read-only file system mounts where possible
- Restrict administrative access to trusted users only
Patch Information
The vulnerability has been fixed in SiYuan version 3.6.1. The patch introduces the util.IsSubPath() validation function to ensure that the resolved write path remains within the designated import directory. For detailed patch information, see the GitHub Release v3.6.1 and GitHub Security Advisory GHSA-qvvf-q994-x79v.
Workarounds
- If immediate upgrade is not possible, disable or restrict access to the import API endpoints via reverse proxy configuration
- Run SiYuan containers with non-root users and implement strict volume mount permissions
- Deploy a web application firewall to filter requests containing path traversal patterns
- Limit administrative access to the SiYuan instance to only essential personnel
# Example: Run SiYuan container as non-root user
docker run -u 1000:1000 --read-only \
-v /path/to/workspace:/workspace:rw \
-v /path/to/temp:/tmp:rw \
siyuan/siyuan:v3.6.1
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


