CVE-2026-82650 in SiYuan
Summary
by MITRE • 08/30/2026
SiYuan 3.8.0 contains a path traversal / sensitive file exposure vulnerability in the RenderTemplate function (kernel/model/template.go), reachable via the POST /api/template/render endpoint (kernel/api/template.go). The endpoint restricts the supplied path only to the workspace directory (util.IsAbsPathInWorkspace) but, unlike the file API's refuseToAccess() blocklist, applies no sensitive-path exclusion. This allows an authenticated attacker to read sensitive workspace files, including conf/conf.json, which contains the API token and cookie signing key. The issue is fixed in v3.8.1.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 08/30/2026
The vulnerability identified in SiYuan version 3.8.0 represents a critical path traversal flaw within the template rendering subsystem, specifically located in the RenderTemplate function found in kernel/model/template.go and exposed via the POST /api/template/render endpoint defined in kernel/api/template.go. This issue stems from an insufficient validation mechanism designed to restrict file access operations exclusively to the designated workspace directory. While the implementation utilizes a utility function named IsAbsPathInWorkspace to ensure that requested paths remain within the boundaries of the user's workspace, it fails to implement additional safeguards against accessing sensitive configuration files or system-critical resources. This oversight creates a significant security gap where an authenticated attacker can manipulate input parameters to traverse outside intended directories and access restricted data structures that were not explicitly blocked by application-level filters.
The technical root cause lies in the disparity between this endpoint's validation logic and other parts of the SiYuan codebase, such as the file API which employs a refuseToAccess blocklist to deny requests for sensitive paths. The RenderTemplate function lacks this comprehensive exclusion list, relying solely on directory containment checks that can be bypassed through standard path traversal techniques or by exploiting how relative paths are resolved against the workspace root. Consequently, an attacker who has valid authentication credentials can craft specific POST requests containing maliciously constructed file paths to read arbitrary files within the workspace environment. This capability is particularly dangerous because it allows for the extraction of sensitive configuration data without requiring privilege escalation beyond standard user access levels.
The operational impact of this vulnerability is severe due to the nature of the exposed assets, most notably the conf/conf.json file located in the root of the workspace directory. This configuration file contains critical security artifacts including API tokens and cookie signing keys which are essential for maintaining session integrity and authenticating subsequent requests against the SiYuan server. The exposure of these credentials enables an attacker to perform identity theft, hijack active user sessions, or potentially escalate privileges by forging valid authentication cookies using the compromised signing key. This effectively compromises the confidentiality and integrity of the entire workspace ecosystem, as the stolen tokens can be used to impersonate legitimate users and access private notes, documents, and other sensitive information stored within the application.
From a classification perspective, this vulnerability aligns with CWE-22 Improper Limitation of a Pathname to a Restricted Directory, which describes flaws where software does not properly neutralize special elements that can cause paths to traverse outside of intended directories. Additionally, it relates closely to CWE-538 Insertion of Sensitive Information into Externally Accessible File, as the vulnerability results in the unauthorized disclosure of sensitive configuration data through an accessible API endpoint. In terms of adversary behavior, this exploit maps to ATT&CK technique T1083 File and Directory Discovery, where attackers search for specific files or directories on a compromised system to gather intelligence necessary for further exploitation. The lack of explicit blocklisting for sensitive paths rather than relying solely on allow-listing workspace boundaries is a common architectural weakness in web applications that handle file operations.
To mitigate this vulnerability, immediate action must be taken by upgrading the SiYuan installation to version 3.8.1 or later, where the developers have addressed these path validation issues and implemented more robust access controls for sensitive files. For environments unable to upgrade immediately, administrators should consider implementing a reverse proxy configuration that restricts direct API access based on IP whitelisting if possible, although this is not a substitute for patching the application logic itself. It is also recommended to rotate all exposed credentials, including API tokens and cookie signing keys, as they are considered compromised due to the potential exposure during the window of vulnerability existence. Future development efforts should prioritize implementing comprehensive blocklists for sensitive file paths across all endpoints that handle filesystem operations, ensuring parity with existing security controls like those in the file API refuseToAccess function to prevent similar traversal attacks from succeeding through other entry points.