---
id: "CVE-2026-30869"
page: "https://infrastack.ai/live/CVE-2026-30869"
kind: "vulnerability"
aliases: ["CVE-2026-30869", "GHSA-2h2p-mvfx-868w"]
title: "SiYuan Vulnerable to Path Traversal in /export Endpoint Allows Arbitrary File Read and Secret Leakage"
severity: "critical"
cvss: 9.8
epss: 0.01191
exploited: false
status: "open"
category: "package"
products: [{"name": "github.com/siyuan-note/siyuan/kernel", "fixed": ["3.5.10"], "affected": "<= 3.5.9", "ecosystem": "go"}, {"name": "b3log siyuan", "fixed": ["3.5.10"], "affected": "< 3.5.10", "ecosystem": "vendor"}]
ecosystems: ["go", "vendor"]
tags: ["cwe-200", "cwe-22", "cwe-285", "go", "package", "self-hosted", "siyuan"]
not_affected_if: ["version-3.5.10-or-later"]
published_at: "2026-03-07T02:19:45+00:00"
first_seen_at: "2026-11-05T21:19:01+00:00"
updated_at: "2026-11-05T21:40:46+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-2h2p-mvfx-868w", "first_seen_at": "2026-11-05T21:19:01+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-30869", "first_seen_at": "2026-11-05T21:40:46+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.01191, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-30869"}]
---

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

Link for people: https://infrastack.ai/live/CVE-2026-30869 (this .md is for agents)

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.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- go:github.com/siyuan-note/siyuan/kernel affected <= 3.5.9 fixed 3.5.10
- vendor:b3log siyuan affected < 3.5.10 fixed 3.5.10

## How to check

- Check the installed SiYuan kernel version against the affected range `<= 3.5.9`.
- Confirm whether the instance has an access auth code set, since localhost requests to `/export/*` get administrator rights in that case.
- Check whether the server responds with HTTP 200 to a GET to `/export/%252e%252e/%252e%252e/conf/conf.json` (read-only test).

## Fix

- SiYuan kernel (go:github.com/siyuan-note/siyuan/kernel): upgrade to `3.5.10`.

## Timeline

- 2026-11-05T21:19:01+00:00 ghsa https://github.com/advisories/GHSA-2h2p-mvfx-868w
- 2026-11-05T21:40:46+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-30869

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/siyuan-note/siyuan/security-advisories/GHSA-2h2p-mvfx-868w
- [advisory] Maintainer's advisory: github.com https://github.com/siyuan-note/siyuan/security/advisories/GHSA-2h2p-mvfx-868w
- [fix] Patch: github.com https://github.com/siyuan-note/siyuan/commit/6feb2bc8ec2dc2d58d62faad68caeec705dbf62d

## From the sources

### 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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
