SiYuan lets users read TLS and CA private keys via getFile
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-552.
Summary
The SiYuan kernel module github.com/siyuan-note/siyuan/kernel before 0.0.0-20260819144130-256d73aa7f94 lets authenticated users read its TLS private key and CA private key through the file API. The blocklist that protects sensitive files matches only conf/conf.json exactly, so conf/key.pem and conf/ca.key are readable (CWE-552). Possession of the TLS key allows decrypting captured HTTPS traffic, and possession of the CA key allows signing certificates that clients trust.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the GitHub advisory
### Summary: `IsForbiddenAbsPath()` only blocks `conf/conf.json` by exact match. The TLS private key (conf/key.pem) and CA private key (conf/ca.key) live in the same conf/ directory and are absent from the blocklist. Any authenticated user can retrieve them via POST `/api/file/getFile`. ### Root cause `kernel/util/path_guard.go`, `IsForbiddenAbsPath()` has no entry for TLS key material. The `getFile` handler at kernel/api/file.go:497 skips the blocklist for RoleAdministrator, and in v3.8.1 all authenticated users receive RoleAdministrator (no non-admin role is currently issued to direct API consumers). The files are generated on every boot regardless of whether TLS is active. ### Steps to reproduce: ``` # No token required on a default no-auth-code instance curl -s -X POST http://TARGET:6806/api/file/getFile \ -H "Content-Type: application/json" \ -d '{"path": "/conf/key.pem"}' ``` ``` curl -s -X POST http://TARGET:6806/api/file/getFile \ -H "Content-Type: application/json" \ -d '{"path": "/conf/ca.key"}' ``` **Response:** Raw PEM private key bytes. <img width="927" height="467" alt="2026-08-19_14-19" src="https://github.com/user-attachments/assets/12e0787f-6bfc-416a-b5ad-a22954e45c48" /> ### Impact: On deployments with TLS enabled (--ssl flag or NetworkServeTLS), possession of `key.pem` allows decryption of captured HTTPS traffic. Possession of `ca.key` allows signing certificates trusted by any client that imported SiYuan's locaprompts users to do). The files exist on every installation even whenTLS is currently inactive. ### Prior art: This is the same class of bug as GHSA-9jfx-rc58-h23j (conf.json readable via template render) and GHSA-c8r8-95hg-mp34 (MCP file tool blocklist incomplete). The fix is to add `conf/key.pem`, `conf/ca.key`, `conf/cert.pem`, and `conf/ca.crt` to `IsForbiddenAbsPath()`.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/siyuan-note/siyuan/kernel (Go) | before 0.0.0-20260819144130-256d73aa7f94 | 0.0.0-20260819144130-256d73aa7f94 | Patch available | GHSA-4wwp-f6gw-6qm5 |
- github.com/siyuan-note/siyuan/kernel (Go) Vendor— Affected before 0.0.0-20260819144130-256d73aa7f94 Fixed in 0.0.0-20260819144130-256d73aa7f94 Patch available GHSA-4wwp-f6gw-6qm5
Remediation
Update github.com/siyuan-note/siyuan/kernel to 0.0.0-20260819144130-256d73aa7f94, which fixes this issue.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · GHSA-4wwp-f6gw-6qm5 github.com/siyuan-note/siyuan/kernel (Go) Fixed in 0.0.0-20260819144130-256d73aa7f94 Advisory →
Timeline
- 2026-10-05 Threatist record created from GHSA-4wwp-f6gw-6qm5
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences