CVE-2026-72811: SiYuan: SQL injection in backlink/mention search via unescaped stored and client input (publish mode): first-order (client keyword) and second-order (stored document title) breakout on read-write handle
The backlink/mention search query (kernel/model/backlink.go) concatenates stored block metadata (title, name, alias, anchor text) and the client-supplied keyword into a SQL MATCH/search statement, escaping only the double-quote character (") and not the single quote ('). A single quote in either the client keyword or in stored document metadata breaks out of the string literal. The query runs on the main read-write siyuan.db handle through a statement-stacking-capable driver.
This yields two vectors:
- First-order: a client-supplied keyword containing
'injects directly. This path is reachable by an anonymous reader on the publish surface. - Second-order: a document whose title/name/alias contains
'is stored safely (indexing uses parameterized inserts) but detonates when that stored value is later concatenated into the backlink query including on another user’s kernel that has ingested the malicious document.
References
- github.com/advisories/GHSA-q2vg-7qgx-x5fc
- github.com/siyuan-note/siyuan/commit/1a5b3431d5ab3036b19c1cc79486fedd6906fb57
- github.com/siyuan-note/siyuan/security/advisories/GHSA-q2vg-7qgx-x5fc
- nvd.nist.gov/vuln/detail/CVE-2026-72811
- www.vulncheck.com/advisories/siyuan-before-sql-injection-via-backlink-search
Code Behaviors & Features
Detect and mitigate CVE-2026-72811 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →