CVE-2026-54068
### Summary The `/api/icon/getDynamicIcon` endpoint is explicitly excluded from authentication in SiYuan's kernel router (`router.go`, "不需要鉴权" -- no auth needed). When called with `type=8` and a valid block `id` parameter, this endpoint invokes `RenderDynamicIconContentTemplate`, which executes a Go template that includes the `querySQL` and `queryBlocks` functions. These functions run arbitrary SELECT statements against the SiYuan SQLite database. An unauthenticated network-adjacent attacker who knows a valid block ID can exfiltrate all user note content, tags, asset references, and block attributes from the database. ### Details **Root cause -- kernel/api/router.go, line 37:** ```go // 不需要鉴权 ginServer.Handle("GET", "/api/icon/getDynamicIcon", getDynamicIcon) ``` **Attack chain:** 1. `getDynamicIcon` (kernel/api/icon.go) checks `type=8` and calls `model.RenderDynamicIconContentTemplate(content, id)` when `content` contains `.action{`. 2. `RenderDynamicIconContentTemplate` (kernel/model/template.go:264) parses `content` as a Go template. The template function map includes `querySQL` and `queryBlocks` registered via `sql.SQLTemplateFuncs`. 3. `querySQL` calls `Query(stmt, 1024)` (kernel/sql/block_query.go) which executes the SQL statement against the SQLite database containing all user notes. 4. The SQL result is rendered into the SVG response body and returned to the unauthenticated caller. **Constraint:** The block `id` parameter must be a valid block ID that exists in the database. Block IDs are 22-character strings in the format `YYYYMMDDHHMMSS-XXXXXXX` (timestamp + 7 alphanumeric chars). Valid IDs are embedded in shared document URLs and can be leaked through any other authenticated endpoint, referrer headers, or browser history. **Tested on SiYuan v3.6.5 (Docker, network-serving mode, access auth code enabled):** ``` GET /api/icon/getDynamicIcon?type=8&content=.action{querySQL+"SELECT+id,content+FROM+blocks+LIMIT+5"}&id=<KNOWN_BLOCK_ID> Host: siyuan.
Properties
- severity
- medium
- summary
- SiYuan: Unauthenticated SQLite Data Exfiltration via Template Injection in /api/icon/getDynamicIcon
- epss_score
- 0.00377
- cvss_score
- 5.9
- ghsa_published
- 2026-07-10T19:26:00Z
- source_url
- https://github.com/advisories/GHSA-gcm7-57gf-953c
- ghsa_updated
- 2026-07-10T19:26:01Z
- ghsa_id
- GHSA-gcm7-57gf-953c
- cve_id
- CVE-2026-54068
- cvss_vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- is_ghsa_only
- false
- epss_percentile
- 0.30405
Related Entities (5)
ENRICHED_BY (1)
REPORTED_BY (1)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
Explore deeper with Ninja Signal's threat intelligence graph