CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-GW25-M53R-QH88

GHSA-gw25-m53r-qh88: Path Traversal Bypass in SiYuan Notebook via /export/temp/ Short-Circuit Branch

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 3, 2026·5 min read·31 visits

Executive Summary (TL;DR)

A validation bypass vulnerability exists in the SiYuan Notebook server's export-handling routing branch, enabling authenticated attackers to perform arbitrary file reads on the host system via path traversal sequences.

An incomplete mitigation in the export-handling logic of SiYuan Notebook allowed authenticated users to bypass directory traversal protections. By crafting a request with percent-encoded path navigation sequences targeting the /export/temp/ route prefix, attackers can trigger an unvalidated short-circuit block that serving arbitrary files from the host server. This bypass renders previous path-traversal mitigations ineffective for the affected endpoint.

Vulnerability Overview

The Go-based backend application of SiYuan Notebook (github.com/siyuan-note/siyuan/kernel) exposes a suite of management endpoints, including the /export/ routing group. This group is responsible for packaging and serving generated documents, database snapshots, and workspace backups to users. Security controls are established on this route to ensure file retrieval is confined within strict physical directory bounds.

In previous development cycles, the product was hardened against unauthorized directory traversal (such as under advisory GHSA-6865-qjcf-286f). This patch integrated protective measures like IsSubPath and IsSensitivePath checks. However, these checks were only applied to the primary handling sequence within the /export/ routing branch.

To facilitate the immediate delivery of transient runtime assets, the developer subsequently implemented a short-circuit branch at the very beginning of the /export/ route handler. This branch matches requests under the /export/temp/ path prefix. Because this branch executes prior to, and independent of, the main logic path, it bypasses both the directory limit verification and the sensitive file extraction protections, exposing a raw path-traversal entry point.

Root Cause Analysis

The technical flaw resides within the serveExport() function of kernel/server/serve.go. When an HTTP request is received, the routing mechanism processes the request through the Go Standard Library and the Gin Web Framework. During this processing, percent-encoded components in the path (such as %2e%2e) are fully decoded to their raw characters (..) prior to route matching.

The application evaluates the incoming request using a prefix conditional check: strings.HasPrefix(c.Request.URL.Path, "/export/temp/"). If a client submits a request to /export/temp/%2e%2e/%2e%2e/etc/passwd, the router decodes it to /export/temp/../../etc/passwd. Because this decoded string still matches the prefix /export/temp/, the conditional statement evaluates to true.

Once inside this short-circuit block, the application attempts to resolve the file path utilizing filepath.Join(util.TempDir, c.Request.URL.Path). In the Go runtime, filepath.Join inherently executes filepath.Clean on the input string. This function recursively resolves parent directory selectors, moving the target path out of the intended root directory. Because the application then passes the resolved path directly to c.File() without performing any logical validation against parent directory markers or canonical root directory containment, an arbitrary file read is completed.

Code Analysis

An examination of the codebase prior to the patch illustrates the structural logic flaw. The route handler maps the file retrieval process without any structural sandboxing in the initial evaluation block:

func serveExport(ginServer *gin.Engine) {
	exportGroup := ginServer.Group("/export/", model.CheckAuth)
	exportBaseDir := filepath.Join(util.TempDir, "export")
 
	exportGroup.GET("/*filepath", func(c *gin.Context) {
		// Vulnerable short-circuit branch
		if strings.HasPrefix(c.Request.URL.Path, "/export/temp/") {
			c.File(filepath.Join(util.TempDir, c.Request.URL.Path))
			return
		}
        // ... Secure path logic with IsSubPath occurs here, but is never reached ...

The patch implemented in commit b763d787d1f2b862c577049e4ee147c5857fe413 fixes this logic vulnerability. It defines a restricted target directory and validates the components before allowing execution to proceed:

	exportGroup.GET("/*filepath", func(c *gin.Context) {
		if strings.HasPrefix(c.Request.URL.Path, "/export/temp/") {
			tempBaseDir := filepath.Join(util.TempDir, "export", "temp")
			relativePath := strings.TrimPrefix(c.Request.URL.Path, "/export/temp/")
			relativePath = filepath.Clean(relativePath)
			
			// Explicitly block any directory traversal indicators
			if strings.Contains(relativePath, "..") {
				c.Status(http.StatusUnauthorized)
				return
			}
			
			fullPath := filepath.Join(tempBaseDir, relativePath)
			// Ensure the final resolved path physically sits inside the designated subpath
			if !gulu.File.IsSubPath(tempBaseDir, fullPath) {
				c.Status(http.StatusUnauthorized)
				return
			}
			c.File(fullPath)
			return
		}

By ensuring the relative path is stripped of the prefix, cleaned, verified against manual parent-traversal patterns, and validated via IsSubPath, the patch prevents any out-of-bounds file serving.

Exploitation Methodology

Exploitation of this vulnerability requires that the attacker has authenticated access to the application, satisfying the model.CheckAuth validation layer. The attack is executed via a single HTTP GET request using traversal characters encoded to escape superficial web-application firewall rules.

The target endpoint decodes the percent-encoded %2e%2e sequences to .. before assessing prefix matches. A request format like /export/temp/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd successfully triggers the short-circuit branch, traverses the server's directory structure, and outputs the target file contents.

Because the system process context is what executes the c.File() action, the scope of file exposure is constrained only by the operating system-level permissions of the user running the SiYuan process.

Impact Assessment

The direct impact of this vulnerability is the unauthorized disclosure of sensitive files from the server's local file system. This includes target system files like /etc/passwd, application database files containing proprietary notebook data, and system logs.

While the vulnerability is restricted to read operations and does not facilitate write access, retrieved information can be used to coordinate more complex system compromise campaigns. Accessing environment configuration files may expose database credentials, authentication keys, and API tokens used elsewhere in the environment.

The CVSS v3.1 score is evaluated at 6.5 (Medium). The score reflects that the vulnerability requires low privilege authentication but can be exploited with low complexity over the network, leading to high confidentiality degradation with zero impact on system availability or integrity.

Remediation and Defensive Strategies

The principal remediation is the direct upgrade of the SiYuan installation to a pseudo-version at or later than 0.0.0-20260510110132-b763d787d1f2 (which integrates the patch commit b763d787d1f2b862c577049e4ee147c5857fe413). This ensures that containment validation logic is enforced even during short-circuit file-serving scenarios.

For deployments where immediate system updates are not viable, administrators should restrict network-level accessibility. Keep the daemon bound strictly to localhost (127.0.0.1) and isolate the network port from untrusted external interfaces.

Additionally, Web Application Firewalls (WAFs) can be configured to filter incoming URI patterns. Rejecting any requests to the /export/ route family that contain percent-encoded directory traversal signatures like %2e%2e or /.. will prevent exploitation attempts.

Official Patches

siyuan-noteFix commit implementing relative path extraction and containment validation

Fix Analysis (2)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Affected Systems

SiYuan Notebook running Go Kernel version < 0.0.0-20260510110132-b763d787d1f2

Affected Versions Detail

Product
Affected Versions
Fixed Version
SiYuan
siyuan-note
< 0.0.0-20260510110132-b763d787d1f20.0.0-20260510110132-b763d787d1f2
AttributeDetail
CWE IDCWE-22 (Improper Limitation of a Pathname to a Restricted Directory)
Attack VectorNetwork
CVSS v3.1 Score6.5 (Medium)
Impact TypeConfidentiality (High)
Exploit StatusProof-of-Concept
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1552Unsecured Credentials
Credential Access
T1213Data from Information Repositories
Collection
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The software uses external input to construct a pathname that is intended to identify a file or directory that is located under a restricted directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Known Exploits & Detection

GitHub Security AdvisoryProof-of-Concept demonstrating directory traversal via /export/temp/ bypass to retrieve sensitive system resources.

Vulnerability Timeline

Hardening advisory for previous path-traversal vulnerabilities published
2026-03-04
Vulnerability bypass resolved in repository commit b763d787d1f2b862c577049e4ee147c5857fe413
2026-05-10
Advisory GHSA-gw25-m53r-qh88 formally published in database
2026-09-03

References & Sources

  • [1]GitHub Security Advisory GHSA-gw25-m53r-qh88
  • [2]SiYuan Vulnerability Fix Commit
  • [3]SiYuan Historical Directory Traversal Advisory
Related Vulnerabilities
CVE-2026-30869

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•9 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
30 views•5 min read
•9 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
18 views•6 min read
•9 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
17 views•5 min read
•9 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
23 views•6 min read
•9 days ago•CVE-2026-70183
7.5

CVE-2026-70183: Elevation of Privilege in ASP.NET Core and Visual Studio via Concurrent Race Condition

An elevation of privilege vulnerability exists in ASP.NET Core and Microsoft Visual Studio due to improper synchronization during concurrent thread execution. Authenticated remote attackers with low privileges can exploit a timing window to manipulate shared resources and assume higher-level execution contexts.

Alon Barad
Alon Barad
20 views•5 min read
•12 days ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
23 views•5 min read