CVE-2026-72807: SiYuan: Second-order SSTI to arbitrary SQL via attribute-view template column (queryBlocks): malicious imported package executes SQL on victim kernel
Attribute-view (AV) template columns are live-evaluated on every render and expose the queryBlocks template function, which runs raw SQL on the read-write database handle (SelectBlocksRawStmt, using ?→argument string substitution rather than parameter binding). AV mutations are admin-gated, so this is not directly reader-injectable but it is a second-order vector: an attacker distributes a SiYuan document or AV package whose template column contains .action{queryBlocks "<arbitrary SQL>"} when a victim imports the package and renders the AV, the attacker’s SQL executes on the victim’s kernel (read and, via statement stacking, write).
References
- github.com/advisories/GHSA-x67c-8pwr-m8g3
- github.com/siyuan-note/siyuan/commit/0a176345e02a0d19bdc7762e50e0b92002087d20
- github.com/siyuan-note/siyuan/security/advisories/GHSA-x67c-8pwr-m8g3
- nvd.nist.gov/vuln/detail/CVE-2026-72807
- www.vulncheck.com/advisories/siyuan-before-sql-injection-via-queryblocks-template
Code Behaviors & Features
Detect and mitigate CVE-2026-72807 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 →