ZeroHour

CVE-2026-72811

niche

SQL Injection in SiYuan Backlink/Mention Search Reachable via Publish Mode

CVSS 4.0
9.9 critical
EPSS
<1%p16
Published
()
Modified
AI analysis

SiYuan's backlink/mention search (kernel/model/backlink.go) concatenates stored block metadata (title, name, alias, anchor text) and the client-supplied keyword directly into a SQLite MATCH/search statement on the main read-write siyuan.db handle, escaping only double quotes and leaving single quotes unescaped (CWE-89). It can be triggered first-order by an anonymous or RoleReader-token client supplying a keyword containing a single quote via the CheckAuth-only backlink/mention API endpoints (reachable when publish mode is enabled and Publish.Auth.Enable is false), and second-order when a stored document title/alias containing a single quote — including one ingested from a malicious .sy file on another user's kernel — is later concatenated into the query. Successful injection permits arbitrary SQL with statement stacking on the read-write handle, giving an attacker cross-notebook read and write (high confidentiality and integrity impact, scope change). Anyone running a SiYuan kernel that exposes the publish surface or the backlink/mention API — particularly with anonymous access enabled — is affected, while indexing and all other query reuse paths were confirmed safe. Exploitation status: no public PoC, not in CISA KEV, and EPSS estimates only a 0.3% probability of exploitation within 30 days.

What to do: Upgrade SiYuan to the first release that escapes single quotes in the backlink/mention search path — no fixed version number is given in the source data, so check the project's release notes for this fix. Until patched, disable publish mode or set Publish.Auth.Enable to true so anonymous readers cannot reach the getBacklink/getBackmentionDoc endpoints, and restrict network access to the SiYuan kernel HTTP port. As an interim hardening measure, avoid single quotes in document titles, names, aliases and search keywords to defuse the second-order stored-injection vector.

Affected
SiYuan (siyuan-note project) SiYuan
Estimated exposure
nichelikely tens of thousands of SiYuan users at most overall, with only publish-mode/backlink-API deployments (plausibly thousands or fewer) network-exposed —… — SiYuan is a niche open-source note-taking application typically deployed as a desktop or local instance, and only kernels running in publish mode with the HTTP API exposed can reach the unauthenticated injection path; no plugin-install…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

SiYuan versions <= v3.7.2 contain a SQL injection vulnerability in the backlink/mention search query (kernel/model/backlink.go), which concatenates stored block metadata (title, name, alias, anchor text) and the client-supplied keyword into a SQL MATCH/search statement while escaping only the double-quote character and not the single quote. A single quote in the client keyword (first-order, reachable by an anonymous or RoleReader user on the publish surface) or in stored document metadata (second-order) breaks out of the string literal. Because the query runs on the main read-write siyuan.db handle via a statement-stacking-capable driver, an attacker can execute arbitrary SQL, enabling cross-notebook read and write. Fixed in v3.7.4.

Ecosystems
go
Weakness
CWE-89
Vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GHSA
GHSA-q2vg-7qgx-x5fc (critical)

In the news

No ingested article mentions this CVE yet.