ZeroHour

CVE-2026-72807

moderate

Second-order SSTI in SiYuan attribute-view template columns enables arbitrary SQL

CVSS 4.0
8.8 high
EPSS
<1%p10
Published
()
Modified
AI analysis

SiYuan's attribute-view (AV) template columns are live-evaluated on every render and expose a queryBlocks template function that passes its argument to the SQLite database as a raw statement using string substitution instead of parameter binding, so attacker-controlled text becomes arbitrary SQL. The flaw is second-order rather than directly injectable: an attacker distributes a SiYuan document or AV package whose template column embeds a queryBlocks call, and when a victim imports the package and the attribute view is rendered, the embedded SQL executes on the victim's kernel. Because the underlying driver supports statement stacking, the attacker's SQL is not limited to reading data and can also write, yielding high confidentiality and integrity impact (CVSS 3.1 score 8.0) with user interaction required. Any SiYuan user who imports third-party documents or AV packages is affected; direct injection is gated behind admin-level AV changes, and the broader SSTI surface (env, expandenv, getHostByName) is already hardened, leaving queryBlocks as the remaining live-evaluated sink. No public proof of concept, KEV listing, or in-the-wild exploitation is known, and EPSS currently estimates a 0.2% probability of exploitation within 30 days.

What to do: No fixed version is identified in the available data, so check SiYuan's release notes and upgrade as soon as the maintainers publish a patched build. Until then, do not import attribute-view packages or documents from untrusted sources, and inspect imported AV template columns for embedded queryBlocks calls before rendering them. Monitor the notes database for unexpected changes, since the flaw permits writes via statement stacking and not just reads.

Affected
SiYuan (88250) SiYuan
Estimated exposure
moderate≈10,000–100,000 users/instances (order-of-magnitude estimate; no install counts or scan data provided) — No install-count or internet-scan data was supplied, so the estimate rests on SiYuan's deployment pattern as a self-hosted, primarily single-user/small-team open-source note-taking application whose affected population is bounded by its…

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

Description

SiYuan versions before v3.7.4 contain a second-order SQL injection vulnerability in attribute-view template columns that expose the queryBlocks function, which executes raw SQL using string substitution instead of parameterized queries. Attackers can distribute malicious SiYuan documents or packages with crafted template columns that execute arbitrary SQL on a victim's kernel when the package is imported and rendered, enabling read and write access across notebooks.

Ecosystems
go
Weakness
CWE-89
Vector
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/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-x67c-8pwr-m8g3 (high)

In the news

No ingested article mentions this CVE yet.