Loading...
Skip to main content

CVE-2026-30869 — SiYuan Vulnerable to Path Traversal in...

CRITICAL

SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage

Published March 7, 2026Updated March 23, 2026Source: osv

Summary

### 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`) 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. - Global CORS `Access-Control-Allow-Origin: *` allows hostile web pages to read localhost responses. ### PoC Reproduction Steps: 1. 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` 2. If HTTP 200 is returned, inspect the response body for sensitive fields: ``` api.token cookieKey accessAuthCode ``` or ``` /etc/passwd ``` 3. (Optional) If api.token is present, test admin API access: ``` POST /api/system/getNetwork Header: Authorization: Token <leaked token> ``` 4. 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.

Advisory Timeline

  • First published March 7, 2026 (219 days ago).
  • Last revised March 23, 2026 — 16 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/siyuan-note/siyuan/kernel to 3.5.10 or later
go get github.com/siyuan-note/siyuan/kernel@v3.5.10

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: go (1).

PackageEcosystemAffectedFixed In
github.com/siyuan-note/siyuan/kernel
go
All versions3.5.10

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-200
    Information ExposureMITRE
  • CWE-22
    Path TraversalMITRE
  • CWE-285
    Improper AuthorizationMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
Low

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L

Frequently Asked Questions

What is CVE-2026-30869?
SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.3/10).
How do I check if my project is affected by CVE-2026-30869?
CVE-2026-30869 affects github.com/siyuan-note/siyuan/kernel. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-30869 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.3

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-2h2p-mvfx-868w
GO-2026-4646

Related CVEs

  • CVE-2026-44588
    CRITICAL

    SiYuan: Electron Renderer RCE via decodeURIComponent-driven tooltip XSS in aria-label sink (incomplete fix for CVE-2026-34585)

  • CVE-2026-45375
    CRITICAL

    SiYuan Bazaar marketplace renders unescaped package `name` and `version` metadata, allowing stored XSS and Electron code execution

  • CVE-2026-72811
    CRITICAL

    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

  • CVE-2026-34448
    CRITICAL

    SiYuan: Stored XSS in Attribute View Gallery/Kanban Cover Rendering Allows Arbitrary Command Execution in Desktop Client

  • CVE-2026-69084
    CRITICAL

    SiYuan: Unauthenticated arbitrary SQL execution via searchEmbedBlock (publish mode) : reader-reachable raw statement on read-write handle, cross-notebook read/write

  • CVE-2026-72789
    HIGH

    SiYuan: The publish-access gate treats encrypted notebooks as publicly accessible by default, allowing anonymous readers to retrieve fully decrypted document content while a notebook is unlocked

  • CVE-2026-72804
    HIGH

    SiYuan: Graph endpoints omit the publish-password tier: anonymous readers receive block-level content of password-protected documents

  • CVE-2026-31809
    MEDIUM

    SiYuan has a SVG Sanitizer Bypass via Whitespace in `javascript:` URI — Unauthenticated XSS

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies