CVE-2026-72811

SiYuan before v3.7.4 SQL Injection via backlink search

Published Aug 14, 2026 CVSS 4.0 · 9.9 Critical EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability exists in SiYuan's backlink/mention search feature (kernel/model/backlink.go) where it naively concatenates user‑supplied search keywords and stored document metadata into a SQL MATCH statement, escaping only double quotes but not single quotes. This allows an attacker to inject a single quote to break out of the string literal, leading to arbitrary SQL execution against the main read‑write siyuan.db handle.

Affected Systems

The affected product is SiYuan, a note‑taking application from Siyuan Note (siyuan‑note). All versions up to and including 3.7.2 are impacted; the fix was released in v3.7.4.

Risk and Exploitability

The CVSS score of 9.9 reflects the full impact of uncontrolled SQL execution. Because an anonymous or RoleReader user can trigger the vulnerable search on the public publish surface, the attacker does not need privileged credentials, and the driver’s support for statement stacking amplifies the damage by allowing read and write across all notebooks. Intrusion is highly likely, and the vulnerability is not yet listed in KEV, but the absence of an EPSS score does not diminish the high inherent risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade SiYuan to version 3.7.4 or later to apply the vendor patch.
  • If upgrading is not immediately possible, restrict or remove anonymous and RoleReader access to the publish surface so that no unauthenticated user can trigger the backlink/mention search endpoint.
  • When a patch is unavailable, configure SiYuan to use a read‑only database connection or disable write permissions on siyuan.db to prevent users from modifying notebook content.

Generated by OpenCVE AI on August 14, 2026 at 12:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-q2vg-7qgx-x5fc 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
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared B3log
B3log siyuan
CPEs cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*
Vendors & Products B3log
B3log siyuan
Type Values Removed Values Added
First Time appeared Siyuan
Siyuan siyuan
Vendors & Products Siyuan
Siyuan siyuan
Type Values Removed Values Added
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.
Title SiYuan before v3.7.4 SQL Injection via backlink search
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 10, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N'}

cvssV4_0

{'score': 9.9, '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'}

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Aug 14, 2026, 4:52 PM
Reserved
Aug 10, 2026, 3:11 PM
Status
Deferred
Published
Aug 14, 2026, 12:16 PM
Modified
Aug 26, 2026, 4:56 PM