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·27 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

•1 day 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
8 views•5 min read
•1 day ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
8 views•4 min read
•1 day ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•1 day ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read