Junglewise Threat Intelligence

CVE-2026-72811: SiYuan backlink search SQL injection via unescaped metadata concatenation

CVE-2026-72811 · Severity: critical · CVSS 10 · Published 2026-09-03

Executive brief

SiYuan is a note-taking and personal knowledge management system that allows users to organize and link documents. The backlink/mention search feature improperly concatenates user input and stored document titles into SQL queries without proper escaping, allowing attackers to inject arbitrary SQL commands. An anonymous user on a publicly shared instance (with publish mode enabled and authentication disabled) can read data from other notebooks, modify data, or attach external databases. Malicious document titles can also trigger the same injection when accessed by other users who have imported the document.

Technical details

The vulnerability is a SQL injection in the backlink/mention search query (kernel/model/backlink.go, line ~980) where stored block metadata (title, name, alias, anchor text) and client-supplied keywords are concatenated into a SQL MATCH statement. The code escapes only double-quote characters but not single quotes, allowing single-quote characters to break out of string literals and inject SQL context. The vulnerable query executes on the main read-write siyuan.db handle via a statement-stacking-capable SQLite driver (88250/go-sqlite3 fork), enabling arbitrary SQL read/write operations across notebooks. Two attack vectors exist: (1) first-order injection via a client-supplied keyword containing single quotes, reachable by anonymous readers in publish mode with auth disabled; (2) second-order injection via malicious document titles stored safely through parameterized INSERTs but executed when concatenated into backlink queries on any kernel that ingests the document. The backlink query functions (getBacklink, getBacklink2, getBacklinkDoc, getBackmentionDoc) use CheckAuth-only protection, making the first-order vector accessible to RoleReader tokens and anonymous accounts. Parameterized queries or consistent single-quote escaping at the query-construction site is required to remediate both vectors.

Affected products

  • SiYuan SiYuan before 0.0.0-20260723004839-1a5b3431d5ab

Timeline

  • 2026-09-03: disclosed: GitHub Advisory Database and CVE-2026-72811 published
  • 2026-07-23: patched: Fix available in commit 1a5b3431d5ab

References

Related threats