CVE-2026-30869: SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage
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.
Published Mar 7, 2026 · Updated Mar 10, 2026
Affected packages
github.com/siyuan-note/siyuan/kernel
- Ecosystem
- Go
- Affected
- <= 3.5.9
- Fixed in
- 3.5.10
- Check
go list -m github.com/siyuan-note/siyuan/kernel
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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](app://-/index.html?hostId=local#), [session.go](app://-/index.html?hostId=local#) 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) bypassesServeFiledot-dot URL rejection but is decoded by app logic into ... CheckAuthgrants 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:
- Send a GET request to
/export/%252e%252e/%252e%252e/conf/conf.jsonorexport/%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
accessAuthCodeor
/etc/passwd- (Optional) If api.token is present, test admin API access:
POST /api/system/getNetwork
Header: Authorization: Token <leaked token>- 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.
Credited to Zwique.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesGHSA-p23f-cm6q-2qp8
SiYuan MCP asset.upload Reads Arbitrary Absolute File Paths (Workspace Boundary Bypass)
medium5.7Oct 2, 2026GHSA-x8gv-g2g3-65fj
SiYuan Agent Tools SSRF via DNS-Rebinding TOCTOU (Bypass of CheckHostSSRF)
high8.2Oct 2, 2026CVE-2026-69085
SiYuan: Unauthenticated SQL injection in searchDocs via unescaped keyword (publish mode): cross-notebook read/write with statement stacking
critical10.0Oct 1, 2026CVE-2026-69083
SiYuan: Unauthenticated SQL execution and REGEXP injection via fullTextSearchAssetContent (publish mode): reader-reachable raw SQL (method 2) and unescaped REGEXP (method 3) on read-write asset-content DB
critical10.0Sep 3, 2026CVE-2026-69084
SiYuan: Unauthenticated arbitrary SQL execution via searchEmbedBlock (publish mode) : reader-reachable raw statement on read-write handle, cross-notebook read/write
critical10.0Sep 3, 2026CVE-2026-72811
SiYuan: SQL injection in backlink/mention search via unescaped stored and client input (publish mode): first-order (client keyword) and second-order (stored document title) breakout on read-write handle
critical10.0Sep 3, 2026
