Oct 5, 2026·6 min read·18 visits
Authenticated users can bypass the path-guard system in SiYuan versions prior to v3.8.2 to extract raw TLS private keys and CA files, enabling traffic decryption or certificate spoofing.
An incomplete path blocklist in the file retrieval engine of the SiYuan knowledge management platform allows authenticated users to read TLS and CA private key materials directly from the configuration directory.
SiYuan is an open-source personal knowledge management platform designed to organize and synchronize markdown-formatted content. The core application exposes an HTTP API allowing users and integrated extensions to interact with the underlying database and file system. This architecture requires strict access control boundaries to prevent unauthorized directory traversal and direct retrieval of security-critical configuration files.
The file retrieval interface, specifically the /api/file/getFile endpoint, acts as a gateway for fetching system and workspace files. To secure this endpoint, the developers implemented a custom path-guard system intended to block access to sensitive data structures. This vulnerability arose from a logical deficiency within the path-guard implementation where the list of restricted files was constructed with an incomplete set of targets.
By exploiting this deficiency, an authenticated user or client possesses the capability to download raw cryptographic keys and CA certificates from the host system. The root cause lies in the application restricting access specifically to a singular configuration database file while neglecting other sensitive configuration material residing in the identical workspace directory.
The vulnerability is categorized as an incomplete blocklist (CWE-184) combined with path traversal limitations (CWE-22) leading to information exposure (CWE-200). Within the application backend, the file access operations are intercepted by the refuseToAccess helper function located in kernel/api/file.go. This function forwards the requested absolute file path to the IsForbiddenAbsPath validation routine in kernel/util/path_guard.go.
The IsForbiddenAbsPath routine was designed to normalize the requested path and compare it against critical application components. However, prior to version v3.8.2, the blocklist logic only checked for equality against the path of the main configuration file, conf/conf.json. No directory-level restrictions were established for the parent conf/ directory, allowing arbitrary file retrieval within that path if the file name did not match conf.json exactly.
During initial configuration, SiYuan generates and stores critical cryptographic assets within this exact conf/ directory. These assets include leaf TLS private keys, public leaf certificates, root CA certificates, and root CA private keys. Because these filenames were omitted from the explicit blocklist, the guard evaluated paths targeting these key files as safe, resulting in raw private key exposure.
To understand the exact code-level flaw, analyze the differences in kernel/util/path_guard.go before and after the patch. In the vulnerable implementation, the system verified the path using the following block:
// Vulnerable Code
func IsForbiddenAbsPath(abs string) bool {
fileNorm := NormalizeAndResolve(abs)
// Only forbidden configuration file conf/conf.json is blocked:
confPath := NormalizeAndResolve(filepath.Join(ConfDir, "conf.json"))
if fileNorm == confPath {
return true
}
// ... (Template and snippet checks continue)
}In this implementation, the filepath.Join(ConfDir, "conf.json") call creates a single static path. If an attacker queries a different file in the configuration directory, such as key.pem, the comparison fileNorm == confPath returns false.
To remediate this, the developer refactored the verification check to iterate over an explicit array of forbidden configuration files. The updated codebase in version v3.8.2 implements the path check with the following logic:
// Patched Code in v3.8.2
func IsForbiddenAbsPath(abs string) bool {
fileNorm := NormalizeAndResolve(abs)
// Block sensitive files under conf/ folder
forbiddenConfFiles := []string{
"conf.json",
TLSCACertFilename, // Defined as "ca.key" / "ca.pem"
TLSCAKeyFilename,
TLSCertFilename,
TLSKeyFilename,
}
for _, filename := range forbiddenConfFiles {
if fileNorm == NormalizeAndResolve(filepath.Join(ConfDir, filename)) {
return true
}
}
// ...
}This iterative validation evaluates each key constant, resolving the absolute path of every cryptographic asset to confirm whether the requested file matches any blocked item.
Exploitation of this vulnerability requires administrative or authenticated API access to the SiYuan local web interface. An attacker who has acquired the kernel authorization token can execute HTTP POST requests directed at /api/file/getFile to retrieve files.
The targeted paths are resolved using standard platform conventions, making the location of cryptographic files highly predictable. The attacker crafts a request payload containing the specific path of the private key relative to the workspace, such as /conf/key.pem or /conf/ca.key.
POST /api/file/getFile HTTP/1.1
Host: localhost:6806
Authorization: Token [API_TOKEN]
Content-Type: application/json
{
"path": "/conf/key.pem"
}The path-guard normalization function resolves the input to its canonical absolute filesystem representation. Because the requested file path does not match /conf/conf.json, the blocklist routine returns false. The server then reads the raw PEM-formatted private key from the filesystem and responds with the raw content in the JSON response payload.
Below is a flowchart representing this validation bypass path:
The security impact of retrieving raw private cryptographic keys is severe and directly compromises the integrity of transport security. In typical deployments, SiYuan utilizes TLS to protect transit data, sync structures, and authorize API clients securely. Compromising the leaf private key allows an attacker with network access to decrypt local or remote session traffic silently.
If the CA private key is obtained, the attacker can sign arbitrary SSL certificates. This allows the attacker to conduct Man-in-the-Middle (MitM) attacks against clients connecting to the platform, capturing passwords, active session cookies, or subsequent synchronization data.
The vulnerability holds a high severity rating because the exposure of core cryptographic secrets is irreversible without a manual certificate and key rotation sequence.
The patch implemented in version v3.8.2 restricts direct retrieval of the TLS certificates and key files by expanding the validation to cover defined constants. However, several minor implementation weaknesses exist. First, because the blocklist is file-specific rather than directory-specific, any newly added sensitive file inside the /conf/ directory in future updates will remain vulnerable until manually added to the blocklist array.
Second, validation bypass risks related to operating system specifics must be considered. On Windows systems where the 8.3 short filename generation (SFN) is enabled, files may be mapped to truncated names such as CONF~1/KEY~1.PEM. If the canonicalization helper NormalizeAndResolve does not call operating system-level APIs to expand 8.3 short paths, bypass opportunities remain.
A more robust architectural solution would involve directory-level blocking, preventing access to the entire conf/ hierarchy by default rather than relying on list enumeration.
| Product | Affected Versions | Fixed Version |
|---|---|---|
SiYuan siyuan-note | < v3.8.2 | v3.8.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-184 (Incomplete List of Disallowed Input Values) |
| Attack Vector | Network (Authenticated API call) |
| CVSS Score | 7.7 |
| Exploit Status | poc |
| KEV Status | Not Listed |
CVE-2026-129304 is an improper input validation and Redis glob pattern injection vulnerability in Guard Core versions 1.0.0 through 3.12.0. The header parsing routine _extract_from_forwarded_header() extracts values from the X-Forwarded-For HTTP header without verifying that the extracted substring is a valid IPv4 or IPv6 address. In deployments configured with trusted_proxies where the target header index is client-controllable, arbitrary strings containing Redis glob metacharacters reach BehaviorTracker and are interpolated directly into Redis key names and blocking KEYS queries. This allows unauthenticated attackers to aggregate cross-client behavioral metrics, trigger false-positive rate limits, cause denial of service via O(N) Redis keyspace scans, or raise unhandled ValueError exceptions during automated IP ban operations.
iSponsorBlockTV prior to version 2.11.0 contains a blind Server-Side Request Forgery (SSRF) vulnerability in its Simple Service Discovery Protocol (SSDP) and Discovery and Launch (DIAL) client implementation. During local device discovery, the application processes SSDP responses without validating that the URL specified in the LOCATION header or the subsequent application-url response header matches the IP address of the responding UDP host. An adjacent network attacker can spoof SSDP responses to induce the iSponsorBlockTV host to send arbitrary HTTP GET requests and constrained HTTP POST requests to internal network endpoints or loopback services.
CVE-2026-121707 is a high-severity Regular Expression Denial of Service (ReDoS) vulnerability in the Effect TypeScript library prior to version 3.22.1. When evaluating untrusted input against Schema.TemplateLiteral definitions containing multiple string spans, the dynamically compiled regular expression exhibits polynomial backtracking complexity. Because JavaScript runtimes execute on a single-threaded event loop, processing specially crafted non-matching strings causes synchronous CPU starvation and complete application unresponsiveness.
CVE-2026-75518 is an incorrect authorization and privilege assignment vulnerability in the DOMShell Model Context Protocol (MCP) server (@apireno/domshell) prior to version 2.0.8. The server classified the domshell_eval tool and the eval command as read-tier operations, permitting their execution without the --allow-write flag. Because the eval command dispatches through the same Chrome DevTools Protocol (CDP) Runtime.evaluate pipeline as the write-tier js command without enabling the throwOnSideEffect constraint, callers restricted to read-only sessions can execute state-mutating JavaScript in the browser context while host user interfaces and audit logs record the activity as read-only.
CVE-2026-63411 (GHSA-xwcw-j52r-34x4) is a remote code execution vulnerability in the Jane PHP code generation framework (janephp/janephp), specifically affecting the jane-php/open-api-3 component prior to version 7.12.0. The generator constructs PHP docblocks using unsanitized parameter names and descriptions extracted directly from OpenAPI specifications. By embedding the comment closing sequence (*/) followed by valid PHP syntax inside an OpenAPI description or parameter name, an attacker can break out of the PHPDoc context and inject executable code directly into the generated class body. When the consuming application instantiates the generated client or endpoint class, an injected __construct() method executes arbitrary PHP code under the privileges of the host runtime.
CVE-2026-63413 is a code injection vulnerability in the Jane PHP OpenAPI 3 SDK generator (jane-php/open-api-3) prior to version 7.12.0. The vulnerability occurs because the generator interpolates OpenAPI header and query parameter names directly into generated PHPDoc comment blocks without sanitizing comment closing delimiters (*/). An attacker who supplies or modifies an OpenAPI specification can break out of the docblock context and inject arbitrary PHP methods, such as a class constructor, into the generated Client or Endpoint class body. When the consuming application instantiates the generated SDK, the injected code executes with the privileges of the host PHP process.