CVE-2026-116171 in SiYuan
Summary
by MITRE • 10/25/2026
SiYuan 3.5.4 before 3.8.7 on Windows contains a sensitive-path denylist bypass in IsSensitivePath because the Windows extended-length prefix (\\?\) survives filepath.Clean and matches no forbidden prefix. Authenticated API callers can prepend the prefix to localPath in /api/import/importStdMd to copy workspace conf files, including the API token and TLS private keys, into assets served to unauthenticated clients.
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 10/25/2026
The vulnerability identified in SiYuan versions prior to 3.8.7 on Windows platforms represents a critical authentication bypass and sensitive data exposure flaw rooted in improper handling of file path normalization. Specifically, the issue resides within the IsSensitivePath function which is designed to prevent access to restricted configuration files such as API tokens and TLS private keys. The core technical failure occurs because the Windows extended-length prefix, denoted by the string \\?\, survives the execution of filepath.Clean operations without being stripped or properly validated against forbidden prefixes. This behavior deviates from expected security controls where path cleaning functions are typically employed to normalize paths and eliminate potential traversal sequences or unauthorized access vectors. Because the prefix remains intact after cleaning, it fails to match any predefined denylist entries that rely on standard relative or absolute path formats, effectively creating a blind spot in the application's input validation logic.
This architectural oversight allows authenticated API callers to exploit the system by prepending the \\?\ prefix to localPath parameters within the /api/import/importStdMd endpoint. By leveraging this specific formatting technique, an attacker can bypass the intended restrictions on file copying operations. The import functionality is designed to process markdown files and integrate them into the workspace, but due to the path validation flaw, it inadvertently permits the duplication of sensitive configuration artifacts from protected directories into public-facing asset folders. These assets are subsequently served directly to unauthenticated clients through standard web requests, effectively exposing credentials that should remain strictly internal and secure.
The operational impact of this vulnerability is severe as it leads to a complete compromise of workspace security integrity. Attackers who possess valid authentication credentials can extract the API token used for programmatic access control and TLS private keys required for encrypted communications. The exposure of these secrets enables further unauthorized actions, including full account takeover via the stolen API token or man-in-the-middle attacks facilitated by the compromised TLS certificates. Since the affected files are served to unauthenticated users, any individual with knowledge of the server structure can retrieve this sensitive data without needing additional privileges beyond initial authentication, significantly lowering the barrier for exploitation and increasing the risk profile for organizations relying on SiYuan for document management.
From a classification perspective, this vulnerability aligns with CWE-284 Improper Access Control as it involves bypassing intended restrictions to access restricted resources. It also relates closely to CWE-530 Exposure of Sensitive Information to an Unauthorized Actor due to the direct leakage of cryptographic keys and authentication tokens. In terms of offensive security frameworks, this exploit maps to ATT&CK technique T1530 Data from Local System Retrieval, where data is stolen from local storage on a compromised system or application environment. The specific mechanism of using path manipulation to bypass access controls also reflects patterns seen in CWE-22 Improper Limitation of a Pathname to a Restricted Directory although the primary failure here is the validation logic rather than simple traversal.
Mitigation strategies must prioritize immediate patching to version 3.8.7 or later where this specific path handling defect has been addressed by developers. In environments where upgrading is not immediately feasible, administrators should implement strict input sanitization at the reverse proxy level to block requests containing the \\?\ prefix if they are directed toward sensitive endpoints. Additionally, reviewing file permission settings on the server hosting SiYuan can help limit damage; ensuring that configuration directories have restrictive permissions independent of web-serving folders provides a layer of defense in depth. Regular audits of exported assets should also be conducted to detect any unauthorized copies of sensitive files that may have been created prior to remediation.