CVE-2026-30869Critical· 9.3▾ MidnightSiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage
▾ Midnight zone — Critical, or high with PoC / in-the-wild
impact 51.2 · likelihood 0.2 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via GHSA
Last analysed / modified upstream
1.2%
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).
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.%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.Access-Control-Allow-Origin: * allows hostile web pages to read localhost responses.Reproduction Steps:
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
If HTTP 200 is returned, inspect the response body for sensitive fields:
api.token
cookieKey
accessAuthCode
or
/etc/passwd
POST /api/system/getNetwork
Header: Authorization: Token <leaked token>
This vulnerability can lead to serious compromise of a SiYuan instance, including:
Arbitrary File Disclosure
Exposure of Sensitive Secrets
Administrative API Access
Cross‑Origin Localhost Data Exfiltration
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)
github.com/siyuan-note/siyuan/kernel <= 3.5.9Upgrade to a patched release:
github.com/siyuan-note/siyuan/kernel 3.5.10Connected by shared product, vendor, weakness, or advisory.
CVE-2026-32704Medium· 6.5SiYuan's renderSprig has a missing admin check that allows any user to read full workspace DB
CVE-2026-33194Medium· 6.8SiYuan has an Incomplete Fix for IsSensitivePath Denylist Allows File Read from /opt, /usr, /home (GHSA-h5vh-m7fg-w5h6 Bypass)
GHSA-3cm4-ccvw-6xr6Medium· 4.9SiYuan: /history/*path and /repo/diff/*path potentially exposing historical snapshots of data/.siyuan/publishAccess.json and data/templates/*
GHSA-p23f-cm6q-2qp8Medium· 5.7SiYuan MCP asset.upload Reads Arbitrary Absolute File Paths (Workspace Boundary Bypass)
CVE-2026-72804High· 8.6SiYuan: Graph endpoints omit the publish-password tier: anonymous readers receive block-level content of password-protected documents
CVE-2026-69086High· 7.7SiYuan: Path Traversal via unvalidated avID in RenderAttributeView/AV read endpoints : reader-reachable cross-scope attribute-view disclo…