GHSA-2h2p-mvfx-868w — kernel
CRITICALGHSA-2h2p-mvfx-868w is a critical-severity (CVSS 9.3) Path Traversal vulnerability in github.com/siyuan-note/siyuan/kernel. A fix is available for github.com/siyuan-note/siyuan/kernel — see the affected versions and patch details below.
SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-2h2p-mvfx-868w.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-2h2p-mvfx-868w plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,166 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
github.com/siyuan-note/siyuan/kernelReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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) 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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/siyuan-note/siyuan/kernel | all versions | 3.5.10go get github.com/siyuan-note/siyuan/kernel@v3.5.10 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/siyuan-note/siyuan/kernel, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/siyuan-note/siyuan/kernel to 3.5.10 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2h2p-mvfx-868w is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-2h2p-mvfx-868w can be triaged on real exposure rather than presence alone.
Tailored to GHSA-2h2p-mvfx-868w. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-2h2p-mvfx-868w in your dependencies?
O3 Security finds GHSA-2h2p-mvfx-868w across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.