CSIRTS // UNIFIED SECURITY ADVISORY FEEDSYS ● ONLINE · POWERED BY INTELFUSIONS.COM

GHSA-gcm7-57gf-953c: SiYuan: Unauthenticated SQLite Data Exfiltration via Template Injection in /api/icon/getDynamicIcon

mediumCVSS 5.9CVE-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: // 不需要鉴权 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.example.com (No Authorization header) Response (SVG with exfiltrated data embed

Details

Source
GitHub Security Advisories (INTL · database · site)
Severity
medium — CVSS 5.9
Published
2026-07-10
Last updated
2026-07-10
Exploitation
Not in CISA KEV at last sync

Original advisory: https://github.com/advisories/GHSA-gcm7-57gf-953c

Exploitation outlook

EPSS (FIRST.org) estimates each CVE’s probability of exploitation in the next 30 days — here is the CSIRTS.com read on those numbers.

Referenced CVEs

CVECSIRTS overviewExternal
CVE-2026-54068coverage & exploitation statusNVD · CVE.org

More from GitHub Security Advisories