Kernel: Duplicate Advisory: SQL injection in backlink/mention search via unescaped stored and client input (publish mode): first-order (client keyword) and second-order (stored document title)…
Description
SiYuan versions up to and including v3.7.2 have a critical SQL injection vulnerability in the backlink/mention search functionality. The vulnerability arises because stored block metadata and client-supplied keywords are concatenated into a SQL MATCH/search statement with insufficient escaping, allowing single quotes to break out of string literals. This enables an attacker to execute arbitrary SQL commands on the main read-write database handle, potentially reading and writing across notebooks. The issue is fixed in version v3.7.4.
CVSS v3.1
Score 10.0critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
SiYuan versions <= v3.7.2 contain a SQL injection vulnerability in the backlink/mention search query (kernel/model/backlink.go). The query concatenates stored block metadata (title, name, alias, anchor text) and client-supplied keywords into a SQL MATCH/search statement, escaping only double quotes but not single quotes. This improper sanitization allows single quotes in client input (first-order injection) or stored document metadata (second-order injection) to break out of string literals. Because the query runs on the main read-write siyuan.db handle via a statement-stacking-capable driver, an attacker can execute arbitrary SQL commands, enabling cross-notebook read and write access. The vulnerability is fixed in version v3.7.4.
Potential Impact
An unauthenticated attacker or a user with RoleReader privileges on the publish surface can exploit this vulnerability to execute arbitrary SQL commands on the main database. This can lead to unauthorized reading and modification of data across notebooks, compromising confidentiality and integrity. The vulnerability has a CVSS 3.1 score of 10.0 (critical), indicating high impact with network attack vector, no privileges required, no user interaction, and scope change.
Mitigation Recommendations
Upgrade to SiYuan version v3.7.4 or later, where this SQL injection vulnerability has been fixed. No other mitigations are indicated. Patch status is confirmed fixed in v3.7.4.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-p8cp-78hp-wmq8
- Osv Schema Version
- 1.4.0
- Ecosystems
- ["Go"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a9ad50bacd9273b49b67cae
Added to database: 09/04/2026, 14:26:19 UTC
Last enriched: 09/07/2026, 13:37:23 UTC
Last updated: 10/04/2026, 04:07:57 UTC
Views: 22
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.