Vulnerability GHSA-2h2p-mvfx-868w

Critical
CRITICAL RISK
CVSS Score: 9.3
Score Range: 9.0–10.0
Critical severity vulnerabilities (CVSS 9.0–10.0). These represent the highest impact issues.
8 months ago
March 07, 2026 at 02:19 AM UTC
SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage
<3.5.10
<3.5.10

Summary

SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage

Details

Summary

A path traversal vulnerability in the /export endpoint allows an attacker to read arbitrary files from the server filesystem. By exploiting double‑encoded traversal sequences, an attacker can access sensitive files such as conf/conf.json, which contains secrets including the API token, cookie signing key, and workspace access authentication code.

Leaking these secrets may enable administrative access to the SiYuan kernel API, and in certain deployment scenarios could potentially be chained into remote code execution (RCE).

Details

File: serve.go, session.go Lines: serve.go 303, 315, 320, 340, 955-957; session.go 292-295

Vulnerable Code:

// session.go
if localhost {
    if strings.HasPrefix(c.Request.RequestURI, "/assets/") || strings.HasPrefix(c.Request.RequestURI, "/export/") {
        c.Set(RoleContextKey, RoleAdministrator)
        c.Next()
        return
    }
}

// serve.go
filePath := strings.TrimPrefix(c.Request.URL.Path, "/export/")
decodedPath, err := url.PathUnescape(filePath)
fullPath := filepath.Join(exportBaseDir, decodedPath)
c.File(fullPath)

// CORS
c.Header("Access-Control-Allow-Origin", "*")

Points of Vulnerability:

  • /export/* trusts url.PathUnescape output and joins it without enforcing fullPath to stay under exportBaseDir.
  • Double-encoded traversal (%252e%252e) bypasses ServeFile dot-dot URL rejection but is decoded by app logic into ...
  • CheckAuth grants admin for localhost requests to /export/* when access auth code is set.
  • Global CORS Access-Control-Allow-Origin: * allows hostile web pages to read localhost responses.

PoC

Reproduction Steps:

  1. Send a GET request to /export/%252e%252e/%252e%252e/conf/conf.json or export/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/%252e%252e/etc/passwd

  2. If HTTP 200 is returned, inspect the response body for sensitive fields:

api.token
cookieKey
accessAuthCode

or

/etc/passwd
  1. (Optional) If api.token is present, test admin API access:
POST /api/system/getNetwork
Header: Authorization: Token <leaked token>
  1. Confirm that the response indicates administrative privileges. All steps can be performed with read-only HTTP requests; no Docker or local modifications are needed.

Impact

This vulnerability can lead to serious compromise of a SiYuan instance, including:

Arbitrary File Disclosure

  • Attackers can read files anywhere on the server filesystem, including system files such as /etc/passwd.

Exposure of Sensitive Secrets

  • Configuration files such as conf/conf.json contain sensitive information including:
  • API tokens
  • cookie signing keys
  • workspace authentication codes

Administrative API Access

  • Leaked tokens can allow attackers to interact with privileged SiYuan kernel APIs.

Cross‑Origin Localhost Data Exfiltration

  • Because the server sets Access-Control-Allow-Origin: *, a malicious website can exploit the vulnerability to read files from a victim's local SiYuan instance running on 127.0.0.1.

Potential Remote Code Execution (RCE)

  • Disclosure of authentication secrets and internal configuration may enable attackers to chain this vulnerability with other application features or APIs to achieve remote code execution or full system compromise.

Related Vulnerabilities

Other vulnerabilities affecting the same packages

Unknown
9 hours ago
SiYuan: MCP file tool's blocklist is incomplete relative to the HTTP file API it claims to align with, exposing publish-mode passwords and other sensitive workspace files in github.com/siyuan-note/siyuan/kernel
<0.0.0-20260808051406-3542530c505f GO-2026-6863
<0.0.0-20260808051406-3542530c505f GO-2026-6863
Unknown
9 hours ago
SiYuan: authFilePublishAccess distinguishes hidden and forbidden documents from public and nonexistent ones, and issues a publish-auth cookie for documents it reports as forbidden in github.com/siyuan-note/siyuan/kernel
<0.0.0-20260731093152-c7522b8db586 GO-2026-6828
<0.0.0-20260731093152-c7522b8db586 GO-2026-6828
Unknown
9 hours ago
SiYuan: A parser differential between the WebSocket keepalive exemption and the session quarantine allows unauthenticated access to the broadcast event stream in github.com/siyuan-note/siyuan/kernel
<0.0.0-20260731131820-67bc300b6ea6 GO-2026-6831
<0.0.0-20260731131820-67bc300b6ea6 GO-2026-6831
Unknown
9 hours ago
SiYuan: The publish filter for database backlinks consults the forbidden list instead of the visibility list, disclosing hidden-tier documents to anonymous readers in github.com/siyuan-note/siyuan/kernel
<0.0.0-20260730150429-5b42614311b0 GO-2026-6833
<0.0.0-20260730150429-5b42614311b0 GO-2026-6833
Unknown
9 hours ago
SiYuan: Missing consistency check between packageName and repoURL/repoHash in bazaar package install allows overwriting an existing, trusted plugin in github.com/siyuan-note/siyuan/kernel
<0.0.0-20260808010544-26ccb40d390e GO-2026-6834
<0.0.0-20260808010544-26ccb40d390e GO-2026-6834
View all vulnerabilities for these packages

Timeline

Published
8 months ago
March 07, 2026 at 02:19 AM UTC
Last Modified
10 hours ago
November 05, 2026 at 09:30 PM UTC