GITHUB.COM/SIYUAN-NOTE/SIYUAN/KERNEL · CVE-2026-30869 · Package
FIX → 3.5.10
SiYuan's /export endpoint joins a double-encoded path into the file path without checking it stays inside the export folder, so a request can read arbitrary files such as conf/conf.json. The leaked API token and keys can then grant administrator access to the SiYuan kernel API, and a malicious web page can read localhost responses because of a wildcard CORS header.
first public Mar 6, 2026 · 2 sources
Check it with your coding agent
It checks your repository and tells you if you’re affected, with the fix.
SiYuan kernel versions up to and including 3.5.9 are exposed, and the flaw is reachable over HTTP on the instance. Self-hosted instances are the ones that matter, since the flaw reads files from the server disk. Instances on a version of 3.5.10 or later can skip it.
Not affected if version-3.5.10-or-later
Who cares cwe-200, cwe-22, cwe-285, go, self-hosted, siyuan
<= 3.5.9./export/* get administrator rights in that case./export/%252e%252e/%252e%252e/conf/conf.json (read-only test).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.(exportBaseDir, decodedPath)
c.(fullPath)
// CORS
c.(, )
Are you affected?
Tell InfraStack what you run. It checks this one, and every next one, against your stack.
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
Upgrade to 3.5.10
3.5.10.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)
This page as .md · .json · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.