CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-72811

CVE-2026-72811: Remote SQL Injection in SiYuan Backlink and Mention Search Engine

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 4, 2026·7 min read·23 visits

Executive Summary (TL;DR)

Unauthenticated remote SQL injection via unescaped string concatenation in SiYuan's SQLite FTS backlink query engine, remediated in v3.7.4.

A critical SQL Injection vulnerability exists in the SiYuan note-taking application (versions <= v3.7.2) due to improper neutralization of single quotes within the backlink and mention search queries. Because the application constructs SQLite Full Text Search (FTS) queries via direct string concatenation and uses a database driver that supports stacked query statements, remote unauthenticated attackers can execute arbitrary SQL commands on the master database, compromising all hosted notebooks. This issue has been fully remediated in version v3.7.4.

Vulnerability Overview

The target component is the backlink and mention search engine of the SiYuan note-taking application, specifically implemented in kernel/model/backlink.go. SiYuan utilizes an internal SQLite database (siyuan.db) to store, index, and organize document hierarchies, metadata, and block contents. The search engine allows users to query links and mentions of specific terms across different notebooks, serving as a critical mechanism for document relationship mapping.

This engine relies on SQLite's Full Text Search (FTS) extension to perform high-performance queries across structured blocks of text. The vulnerability, tracked as CVE-2026-72811, is classified under CWE-89 (SQL Injection) and carries a critical CVSS v3.1 base score of 10.0. The vulnerability surfaces because the application constructs dynamic SQL queries by appending client-supplied inputs and database-stored document titles directly into the SQLite MATCH statement string.

The attack surface is exposed directly through public-facing search endpoints, which are active when notebooks are published or when collaborative multi-user modes are enabled. Because the database driver supports statement stacking, a remote unauthenticated attacker can execute arbitrary SQL statements. This allows bypass of logical restrictions, write access to system tables, and potential system compromise beyond the application's sandbox context.

Root Cause Analysis

The root cause of CVE-2026-72811 lies in the flawed sanitization logic within searchBackmentionInBox in kernel/model/backlink.go. The system attempts to dynamically generate a SQLite FTS5 MATCH expression by manual string concatenation using a bytes.Buffer. The generated query template encapsulates the full FTS syntax inside single quotes, such as MATCH 'content:(...) '.

While building individual keyword constraints, the application tries to account for the double quotes used to denote specific phrases in FTS. It replaces double quotes with escaped double quotes ("") using strings.ReplaceAll(keyword, "\"", "\"\""). This replacement ensures the internal structure of the FTS query string remains intact and parses correctly as an FTS phrase.

However, the system completely fails to sanitize or escape single quotes (') within either the client-submitted keywords or the document metadata loaded from the database. Because the entire MATCH parameter is enclosed in single quotes, injecting a single quote inside a keyword or title prematurely terminates the string literal boundary of the FTS expression. An attacker can then inject arbitrary SQL commands following the closed single quote.

The vulnerability is further worsened because the Go database driver used by SiYuan allows stacked queries separated by semicolons (;). SQLite compiles and executes sequential statements within a single query execution block on the active connection. This design behavior allows an attacker to pivot from a simple FTS query breakout to full read and write operations on the siyuan.db database.

Code-Level Analysis of Vulnerability and Fix

Prior to the patch, the searchBackmentionInBox function constructed raw SQL statements directly in memory. The application concatenated unsanitized parameters into a local buffer. This process can be modeled visually to understand the data flow from source to sink.

The critical vulnerability resides in how the system built the query inside backlink.go. Below is the vulnerable segment of code demonstrating the raw concatenation logic:

// Vulnerable raw query construction (Pre-patch)
buf.WriteString("SELECT * FROM " + table + " WHERE " + table + " MATCH '" + columnFilter() + ":(")
for i, mentionKeyword := range mentionKeywords {
    mentionKeyword = strings.ReplaceAll(mentionKeyword, "\"", "\"\"")
    buf.WriteString("\"" + mentionKeyword + "\"")
    // ... OR operators are written
}
buf.WriteString(")")
if "" != keyword {
    keyword = strings.ReplaceAll(keyword, "\"", "\"\"")
    buf.WriteString(" AND (\"" + keyword + "\")")
}
buf.WriteString("'") // Closes the FTS single-quote block
buf.WriteString(" AND root_id != '" + rootID + "'")

In the patched code (Commit 1a5b3431d5ab3036b19c1cc79486fedd6906fb57), the developers introduced complete parameterization. They decoupled the structure of the SQL query from the values being filtered.

// Patched secure query construction (Post-patch)
func buildBackmentionQuery(matchExpression, rootID string, limit int) (query string, args []any) {
    query = "SELECT * FROM blocks_fts WHERE blocks_fts MATCH ? AND root_id != ?" +
        " AND type IN ('d', 'h', 'p', 't') ORDER BY id DESC LIMIT ?"
    args = []any{matchExpression, rootID, limit}
    return
}
 
func quoteFTSPhrase(phrase string) string {
    return "\"" + strings.ReplaceAll(phrase, "\"", "\"\"") + "\""
}

This structural shift completely eliminates the possibility of SQL injection. The FTS expression itself is parameterized as a single bound parameter ?, which the database engine treats strictly as a data literal, preventing any injection of SQL syntax.

Exploitation and Attack Methodology

Exploitation of CVE-2026-72811 can be achieved through two primary attack vectors depending on the attacker's level of access. The first vector is first-order exploitation, which targets public-facing search endpoints. An unauthenticated remote attacker issues a HTTP POST request to the backlink search API.

POST /api/backlink/search HTTP/1.1
Host: target-siyuan.local
Content-Type: application/json
 
{
  "keyword": "exploit') ; ATTACH DATABASE '/tmp/pwn.db' AS pwn; --"
}

The system processes the request and maps the keyword parameter directly into the SQLite search engine. Since the single quote is not escaped, the backend executes the ATTACH DATABASE statement, allowing the attacker to construct arbitrary files on the local filesystem where the application runs.

The second vector is a second-order exploitation approach that occurs when malicious payloads are stored in the database. An attacker with write access creates a block containing a crafted document title with embedded SQL statements. When another user views a document that references this block, the server fetches the document title to search for mentions. The unescaped title is concatenated directly into the FTS engine, executing the payload in the context of the active user session.

Comprehensive Security Impact

The security impact of CVE-2026-72811 is rated as Critical with a CVSS v3.1 score of 10.0. A successful exploitation allows full read and write access to the underlying SQLite database file siyuan.db. This database houses critical application configurations, access tokens, integration keys, and full text contents of all private notebooks.

Because the SQLite connection supports statement stacking, attackers can run arbitrary SQL commands. This capability bypasses any application-level authorization limits. An attacker can extract system configuration parameters, modify document contents, or introduce cross-site scripting (XSS) payloads into notebook pages that execute when other users synchronize or read the affected notebooks.

Additionally, although SQLite does not naturally support standard external system shells, features such as ATTACH DATABASE can be used to write arbitrary files to specific locations on the server, depending on user permissions. In environments running with elevated privileges, this primitive can be leveraged to write local configuration files, leading to remote code execution.

Remediation and Defense-in-Depth

The primary and recommended mitigation for CVE-2026-72811 is to upgrade the SiYuan application to version v3.7.4 or higher. The patch fully mitigates the vulnerability by transitioning the dynamic query construction process into a parameterized SQL statement. This ensures all user-supplied inputs are securely bound as parameter values rather than raw SQL command elements.

If an immediate upgrade is not feasible, several temporary workarounds should be applied to reduce the attack surface. Administrators should immediately disable any public-facing publish mode capabilities on the instance. Restricting the network availability of the SiYuan container or server to local loopback or a secure VPN prevents external threat actors from reaching the affected endpoint.

Deploying Web Application Firewall (WAF) rules can help detect and block exploitation attempts before they reach the application. A custom WAF rule can monitor the request body of search endpoints for unescaped single quotes combined with SQL keywords. This validation layer serves as an effective defense-in-depth measure while the core application is scheduled for an update.

Official Patches

siyuan-noteOfficial fix commit implementing parameterized search in backlink.go

Fix Analysis (1)

Technical Appendix

CVSS Score
10.0/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
EPSS Probability
0.25%
Top 84% most exploited

Affected Systems

SiYuan Note-Taking Application

Affected Versions Detail

Product
Affected Versions
Fixed Version
SiYuan
siyuan-note
<= v3.7.2v3.7.4
AttributeDetail
CWE IDCWE-89 (Improper Neutralization of Special Elements used in an SQL Command)
Attack VectorNetwork (Unauthenticated, Remote)
CVSS v3.1 Score10.0 (Critical)
EPSS Score0.0025 (Percentile: 16.27%)
ImpactArbitrary Database Read/Write and System Configuration Alteration
Exploit StatusProof-of-Concept (PoC) documented in research
KEV StatusNot Listed in CISA Known Exploited Vulnerabilities

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to the database.

Vulnerability Timeline

Official fix commit authored in the siyuan-note/siyuan repository
2026-07-23
GitHub Security Advisory GHSA-q2vg-7qgx-x5fc published
2026-08-14
CVE-2026-72811 published by VulnCheck
2026-08-14
Vulnerability details updated in the National Vulnerability Database (NVD)
2026-08-26

References & Sources

  • [1]GitHub Security Advisory GHSA-q2vg-7qgx-x5fc
  • [2]SiYuan Parameterization Commit
  • [3]VulnCheck Security Advisory
  • [4]NVD Entry for CVE-2026-72811
  • [5]CVE Record on CVE.org

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•9 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
30 views•5 min read
•9 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
18 views•6 min read
•9 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
17 views•5 min read
•9 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
23 views•6 min read
•9 days ago•CVE-2026-70183
7.5

CVE-2026-70183: Elevation of Privilege in ASP.NET Core and Visual Studio via Concurrent Race Condition

An elevation of privilege vulnerability exists in ASP.NET Core and Microsoft Visual Studio due to improper synchronization during concurrent thread execution. Authenticated remote attackers with low privileges can exploit a timing window to manipulate shared resources and assume higher-level execution contexts.

Alon Barad
Alon Barad
20 views•5 min read
•12 days ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
23 views•5 min read