CVE-2026-23851 Overview
CVE-2026-23851 is a path traversal vulnerability affecting SiYuan, a personal knowledge management system. Versions prior to 3.5.4 contain a logic vulnerability in the /api/file/globalCopyFiles endpoint that allows authenticated users to copy files from any location on the server's filesystem into the application's workspace without proper path validation.
The vulnerability exists in the api/file.go source code where the globalCopyFiles function accepts a list of source paths from the JSON request body. While the code checks if the source file exists using filelock.IsExist(src), it fails to validate whether the source path resides within the authorized workspace directory, enabling arbitrary file read operations through path traversal techniques.
Critical Impact
Authenticated attackers can exploit this vulnerability to access sensitive system files, configuration files, credentials, and other confidential data stored on the server, potentially leading to further system compromise.
Affected Products
- SiYuan versions prior to 3.5.4
Discovery Timeline
- 2026-01-19 - CVE-2026-23851 published to NVD
- 2026-01-19 - Last updated in NVD database
Technical Details for CVE-2026-23851
Vulnerability Analysis
This path traversal vulnerability (CWE-22) allows authenticated users to bypass directory restrictions and access files outside the intended workspace directory. The core issue lies in the insufficient validation of user-supplied file paths in the /api/file/globalCopyFiles API endpoint.
When processing file copy requests, the application only verifies that the specified source file exists but does not enforce boundaries to ensure the source path remains within the authorized workspace. This oversight allows attackers to use path traversal sequences (such as ../) or absolute paths to reference files anywhere on the server's filesystem.
The vulnerability requires authentication to exploit, meaning an attacker must have valid credentials or session access to the SiYuan application. Once authenticated, the attacker can craft malicious API requests to copy sensitive system files—such as /etc/passwd, /etc/shadow, application configuration files, or database credentials—into the workspace where they become accessible.
Root Cause
The root cause is improper input validation in the globalCopyFiles function within api/file.go. The function accepts source file paths (srcs) from user-controlled JSON request data and passes them directly to file operations without validating that these paths are contained within the authorized workspace directory. The existence check using filelock.IsExist(src) is insufficient as it only confirms the file exists, not that the user should have access to it.
Attack Vector
An authenticated attacker can exploit this vulnerability by sending a crafted HTTP POST request to the /api/file/globalCopyFiles endpoint with malicious source paths. The attack is network-accessible and requires low complexity to execute. By specifying absolute paths or relative paths containing traversal sequences, the attacker can copy arbitrary files from the server filesystem into the SiYuan workspace, effectively exfiltrating sensitive data.
The vulnerability enables reading of system configuration files, application secrets, SSH keys, database credentials, and other sensitive information stored on the server. This information disclosure could facilitate further attacks, including privilege escalation or lateral movement within the network.
Detection Methods for CVE-2026-23851
Indicators of Compromise
- Unusual API requests to /api/file/globalCopyFiles containing path traversal sequences (../) or absolute system paths
- Unexpected files appearing in the SiYuan workspace directory that match system configuration files
- Access logs showing repeated requests to the vulnerable endpoint with varying source paths
- Presence of sensitive system files (e.g., /etc/passwd, .env, configuration files) copied into workspace directories
Detection Strategies
- Monitor HTTP request logs for POST requests to /api/file/globalCopyFiles containing suspicious path patterns
- Implement web application firewall (WAF) rules to detect and block path traversal attempts in API parameters
- Review SiYuan application logs for file copy operations with source paths outside the workspace directory
- Deploy file integrity monitoring on sensitive system directories to detect unauthorized access
Monitoring Recommendations
- Enable detailed logging for the SiYuan API endpoints, particularly file operations
- Configure SIEM alerts for patterns indicative of path traversal attacks in web application logs
- Monitor for anomalous file access patterns in application workspace directories
- Regularly audit files created in SiYuan workspaces for unexpected or sensitive content
How to Mitigate CVE-2026-23851
Immediate Actions Required
- Upgrade SiYuan to version 3.5.4 or later immediately to address this vulnerability
- Review recent API access logs for signs of exploitation attempts
- Audit workspace directories for any files that may have been copied from unauthorized locations
- Restrict network access to SiYuan instances to trusted users and networks where possible
- Implement additional authentication controls if public-facing deployment is required
Patch Information
The vulnerability has been patched in SiYuan version 3.5.4. The fix implements proper path validation to ensure that source paths in file copy operations are restricted to the authorized workspace directory. Security patches are available through the following commits:
Additional details are available in the GitHub Security Advisory GHSA-94c7-g2fj-7682 and the GitHub Issue #16860.
Workarounds
- Restrict access to the SiYuan application to trusted users only until patching is complete
- Implement network-level access controls (firewall rules, VPN requirements) to limit exposure
- Deploy a reverse proxy or WAF with rules to filter path traversal patterns in API requests
- Disable or restrict the /api/file/globalCopyFiles endpoint if not required for operations
- Monitor and audit all file operations within the application pending upgrade to the patched version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


