GHSA-2H2P-MVFX-868W
Vulnerability from github – Published: 2026-03-07 02:19 – Updated: 2026-03-10 18:43Summary
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) 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
accessAuthCode
or
/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.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.5.9"
},
"package": {
"ecosystem": "Go",
"name": "github.com/siyuan-note/siyuan/kernel"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.5.10"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-30869"
],
"database_specific": {
"cwe_ids": [
"CWE-200",
"CWE-22",
"CWE-285"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-07T02:19:45Z",
"nvd_published_at": "2026-03-10T17:40:14Z",
"severity": "CRITICAL"
},
"details": "### Summary\nA path traversal vulnerability in the `/export` endpoint allows an attacker to read arbitrary files from the server filesystem. By exploiting double\u2011encoded 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.\n\nLeaking 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)`.\n\n### Details\nFile: [serve.go](app://-/index.html?hostId=local#), [session.go](app://-/index.html?hostId=local#)\nLines: serve.go 303, 315, 320, 340, 955-957; session.go 292-295\n\nVulnerable Code:\n```\n// session.go\nif localhost {\n if strings.HasPrefix(c.Request.RequestURI, \"/assets/\") || strings.HasPrefix(c.Request.RequestURI, \"/export/\") {\n c.Set(RoleContextKey, RoleAdministrator)\n c.Next()\n return\n }\n}\n\n// serve.go\nfilePath := strings.TrimPrefix(c.Request.URL.Path, \"/export/\")\ndecodedPath, err := url.PathUnescape(filePath)\nfullPath := filepath.Join(exportBaseDir, decodedPath)\nc.File(fullPath)\n\n// CORS\nc.Header(\"Access-Control-Allow-Origin\", \"*\")\n\n```\nPoints of Vulnerability:\n\n- `/export/*` trusts url.PathUnescape output and joins it without enforcing fullPath to stay under exportBaseDir.\n- Double-encoded traversal (`%252e%252e`) bypasses `ServeFile` dot-dot URL rejection but is decoded by app logic into ...\n- `CheckAuth` grants admin for localhost requests to `/export/*` when access auth code is set.\n- Global CORS `Access-Control-Allow-Origin: *` allows hostile web pages to read localhost responses.\n\n### PoC\n\nReproduction Steps:\n\n1. 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`\n\n2. If HTTP 200 is returned, inspect the response body for sensitive fields:\n```\napi.token\ncookieKey\naccessAuthCode\n```\nor\n```\n/etc/passwd\n```\n\n3. (Optional) If api.token is present, test admin API access:\n```\nPOST /api/system/getNetwork\nHeader: Authorization: Token \u003cleaked token\u003e\n```\n\n4. Confirm that the response indicates administrative privileges.\nAll steps can be performed with read-only HTTP requests; no Docker or local modifications are needed.\n### Impact\n\nThis vulnerability can lead to serious compromise of a SiYuan instance, including:\n\n**Arbitrary File Disclosure**\n- Attackers can read files anywhere on the server filesystem, including system files such as /etc/passwd.\n\n**Exposure of Sensitive Secrets**\n- Configuration files such as conf/conf.json contain sensitive information including:\n- API tokens\n- cookie signing keys\n- workspace authentication codes\n\n**Administrative API Access**\n- Leaked tokens can allow attackers to interact with privileged SiYuan kernel APIs.\n\n**Cross\u2011Origin Localhost Data Exfiltration**\n- Because the server sets `Access-Control-Allow-Origin: *`, a malicious website can exploit the vulnerability to read files from a victim\u0027s local SiYuan instance running on 127.0.0.1.\n\n**Potential Remote Code Execution (RCE)**\n- 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.",
"id": "GHSA-2h2p-mvfx-868w",
"modified": "2026-03-10T18:43:18Z",
"published": "2026-03-07T02:19:45Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-2h2p-mvfx-868w"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-30869"
},
{
"type": "PACKAGE",
"url": "https://github.com/siyuan-note/siyuan"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.