CVE-2026-54068 Overview
CVE-2026-54068 is an authentication bypass vulnerability in SiYuan, an open-source personal knowledge management system. The flaw resides in the /api/icon/getDynamicIcon endpoint, which the kernel router (router.go) explicitly excludes from authentication. When invoked with type=8 and a valid block ID, the endpoint calls RenderDynamicIconContentTemplate, executing a Go template that exposes the querySQL and queryBlocks functions. These functions run arbitrary SELECT statements against the SiYuan SQLite database. The vulnerability is fixed in version 3.7.0 and is classified under [CWE-306] Missing Authentication for Critical Function.
Critical Impact
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 SiYuan database.
Affected Products
- SiYuan versions prior to 3.7.0
- SiYuan kernel router component (router.go)
- SiYuan dynamic icon rendering subsystem
Discovery Timeline
- 2026-06-24 - CVE-2026-54068 published to NVD
- 2026-06-25 - Last updated in NVD database
Technical Details for CVE-2026-54068
Vulnerability Analysis
The vulnerability stems from an explicit authentication exclusion in SiYuan's kernel HTTP router. The /api/icon/getDynamicIcon endpoint is annotated in router.go with a comment indicating no authentication is required ("不需要鉴权"). Attackers can reach this endpoint without supplying credentials or session tokens.
When the endpoint receives a request with type=8 and a block ID parameter, it invokes RenderDynamicIconContentTemplate. This function executes a Go template that exposes the querySQL and queryBlocks helpers. Both helpers accept arbitrary SELECT statements and execute them against the underlying SQLite database that stores all user notes.
Because the template engine evaluates attacker-controlled input as SQL, the endpoint effectively becomes an unauthenticated SQL query proxy. The attacker reads notes, block attributes, tags, and asset references without ever authenticating to the application.
Root Cause
The root cause is missing authentication on a sensitive API route combined with overly permissive template helpers. The router treats dynamic icon rendering as a public utility, while the template handler grants direct database read access through querySQL and queryBlocks. Neither layer enforces authorization or sanitizes the SQL passed through the template.
Attack Vector
Exploitation requires network access to the SiYuan kernel HTTP service and knowledge of a valid block ID. The attacker sends a crafted GET request to /api/icon/getDynamicIcon with type=8 and the target block ID, supplying a Go template payload that invokes querySQL with arbitrary SELECT statements. The server returns the query results in the rendered icon response.
The high attack complexity reflects the prerequisite of obtaining a valid block ID, which is not predictable without prior reconnaissance or access to leaked references. For details, see the GitHub Security Advisory.
Detection Methods for CVE-2026-54068
Indicators of Compromise
- Unauthenticated HTTP GET requests to /api/icon/getDynamicIcon containing type=8 and a block id parameter.
- Request bodies or query strings containing Go template directives referencing querySQL or queryBlocks.
- Unusual outbound response sizes from the SiYuan kernel port when serving the dynamic icon endpoint.
Detection Strategies
- Inspect web server and reverse proxy logs for repeated requests to /api/icon/getDynamicIcon from external or untrusted networks.
- Alert on requests to that endpoint that lack referer headers consistent with the SiYuan client.
- Correlate access spikes against the dynamic icon path with subsequent data exposure indicators in downstream systems.
Monitoring Recommendations
- Forward SiYuan kernel access logs to a centralized log platform for retention and search.
- Monitor for SQL-like syntax (SELECT, FROM, WHERE) appearing in HTTP query parameters bound for SiYuan.
- Track the SiYuan kernel version inventory and flag hosts running versions earlier than 3.7.0.
How to Mitigate CVE-2026-54068
Immediate Actions Required
- Upgrade all SiYuan installations to version 3.7.0 or later, which removes the authentication exclusion on the dynamic icon endpoint.
- Restrict network access to the SiYuan kernel port so that only trusted local clients can reach the HTTP API.
- Audit logs for prior requests to /api/icon/getDynamicIcon and assess whether note content may have been exfiltrated.
Patch Information
The maintainers fixed the issue in SiYuan 3.7.0. Refer to the GitHub Security Advisory GHSA-gcm7-57gf-953c for upstream remediation details and commit references.
Workarounds
- Bind the SiYuan kernel to localhost only and use SSH tunneling for remote access until patching is complete.
- Place SiYuan behind a reverse proxy that enforces authentication on /api/icon/getDynamicIcon and blocks template-like payloads.
- Apply host firewall rules to limit inbound connections to the SiYuan kernel port to a defined allow-list.
# Example: restrict SiYuan kernel to localhost and allow only an SSH tunnel
# Linux iptables example
iptables -A INPUT -p tcp --dport 6806 -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 6806 -j DROP
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

