Sep 4, 2026·6 min read·37 visits
Unauthenticated remote attackers can execute arbitrary SQL commands on SiYuan's SQLite database via the full-text search endpoint, resulting in complete exposure or modification of indexed documents and application metadata.
An unauthenticated SQL injection and SQL execution vulnerability in SiYuan allows remote attackers to compromise the integrity and confidentiality of the asset database. The flaw exists due to string concatenation in regular expression searches and a complete lack of authorization checks on raw SQL querying pathways under default configurations. Attackers can leverage this vulnerability to exfiltrate database contents, manipulate index records, or access cross-notebook contents without any valid credentials.
SiYuan is a local-first personal knowledge management platform written in Go. Under typical deployments, it opens an HTTP API to coordinate search requests, asset indexing, and remote document synchronization. The vulnerability is located in the backend application handler responsible for full-text search processes, specifically routed to the endpoint path /api/search/fullTextSearchAssetContent. This endpoint constitutes a major attack surface because it is accessible to unauthenticated remote callers by default.
Under default configuration states where the variable Conf.AccessAuthCode is not defined or is left blank, the application architecture automatically elevates all external requests to the privilege level of an administrator. This architecture allows unauthenticated remote actors on accessible networks to interact directly with the underlying SQLite database engine. Because the database handle operates with read-write privileges, the vulnerability class corresponds to improper neutralization of special elements in an SQL command (CWE-89).
A deep technical analysis of the application codebase reveals two distinct software flaws operating inside the asset search API module. In the case of method 3 (regular expression searches), incoming parameters are processed through the controller function fullTextSearchAssetContentByRegexp within kernel/model/asset_content.go. This module generates dynamic SQL queries by interpolating user-supplied search parameters directly into a string literal pattern.
The dynamic construction is managed by the helper function assetContentFieldRegexp which appends raw user input without applying character escaping or escaping quote characters. A single quote character within the query input successfully escapes the string boundary within the REGEXP SQL condition, allowing arbitrary command insertion. This is a classic implementation error where raw user input is treated as executable code by the database parser.
In the case of method 2 (raw SQL search mode), the application passes the request payload directly to searchAssetContentBySQL. This controller function passes the entire query string straight to the raw database executor without invoking authorization checks or command validation logic. Unlike neighboring endpoints designed for similar metadata indexing tasks, this function entirely omitted access control validation, allowing any caller to execute any SQLite command string directly.
Analyzing the codebase prior to the 3.7.3 release highlights the vulnerable code path in kernel/model/asset_content.go. The following snippet illustrates how the unsafe regular expression string was constructed:
// Vulnerable string construction in method 3
func assetContentFieldRegexp(exp string) string {
buf := bytes.Buffer{}
buf.WriteString("(name REGEXP '")
buf.WriteString(exp)
buf.WriteString("' OR content REGEXP '")
buf.WriteString(exp)
buf.WriteString("')")
return buf.String()
}The resulting string from assetContentFieldRegexp is directly interpolated into the parent SQL query template:
stmt := "SELECT * FROM `asset_contents_fts_case_insensitive` WHERE " + fieldFilter + " AND ext IN " + typeFilterIn the patched codebase (commit cf42dd5680c8f2d50cebfada5d639c8d59faf50e), the dynamic string concatenation was replaced entirely by safe parameter-binding APIs. The patch isolates variables from the executable statement structure:
// Patched parameterized structure
func assetContentFieldRegexp(exp string) (clause string, args []any) {
clause = "(name REGEXP ? OR content REGEXP ?)"
args = []any{exp, exp}
return
}Additionally, the patch introduced an authorization validation step within kernel/api/search.go to block non-administrator access to the raw SQL querying path (method 2):
if method == 2 && !model.IsAdminRoleContext(c) {
ret.Code = -1
ret.Msg = "SQL search requires administrator privileges"
return
}An attack begins by probing the target endpoint to verify if authentication requirements are absent on port 6806. Once confirmed, the attacker can submit a crafted HTTP POST request to the target path /api/search/fullTextSearchAssetContent containing a payload designed to target method 3. By inserting a single quote, trailing commands, and an inline comment characters sequence, the attacker manipulates the parser logic.
A sample JSON exploit payload targeting the REGEXP engine is constructed as follows:
{
"query": "xyz') OR 1=1 -- ",
"types": {},
"method": 3,
"orderBy": 0,
"page": 1,
"pageSize": 64
}When processed by the database backend, the query is parsed as SELECT * FROM asset_contents_fts_case_insensitive WHERE (name REGEXP 'xyz') OR 1=1 -- .... The trailing comment characters sequence -- instructs the SQLite compiler to drop all subsequent filter assertions. This returns every record stored inside the full-text search asset database table directly within the response payload. Alternatively, attackers can send direct SQL commands using method 2 payloads to alter system metadata or query indexed records.
The security implications of CVE-2026-69083 are critical. An unauthorized attacker can read all indexed notebooks, text segments, synchronization logs, and document assets. The confidentiality of all data assets managed within the application is compromised.
In addition, because the database handler operates with read-write capabilities on SQLite, an attacker can modify index files or delete stored assets, disrupting indexing integrity. Since SQLite features the capability to attach external storage structures via advanced query syntax (e.g., ATTACH DATABASE), there is a risk that attackers can execute arbitrary code on the hosting environment if specific filesystem write permissions are present.
This vulnerability is particularly severe because the application is designed to store personal knowledge assets, which frequently include sensitive elements such as system credentials, network topology descriptions, and personal identifying information. The CVSS vector reflects a critical impact across confidentiality and integrity vectors.
Remediation requires upgrading the SiYuan application to version 3.7.3 or later. This update enforces parameterized data input across search controllers and adds mandatory validation checks on administrative endpoints.
For instances where immediate updates are not possible, administrators must configure a non-empty administrative access authentication key. Specifying the Conf.AccessAuthCode parameter in the environment configuration enforces authentication, preventing unauthenticated callers from obtaining automatic administrative privileges.
To detect and block exploit attempts at the perimeter, network security operators can deploy custom Web Application Firewall (WAF) filters. Rules should target incoming POST requests directed to /api/search/fullTextSearchAssetContent and flag payloads that contain single quotes or comments within the search string while method parameters are set to 2 or 3.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
SiYuan siyuan-note | < 3.7.3 | 3.7.3 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-89 |
| Attack Vector | Network (AV:N) |
| CVSS Score | 10.0 (Critical) |
| EPSS Score | 0.0035 (27.97th percentile) |
| Exploit Status | Functional PoC Available |
| CISA KEV Status | Not Listed |
The software constructs an SQL command using input from an upstream component, but does not neutralize or incorrectly neutralizes special elements that can modify the SQL command.
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.
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.
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.
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.
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.
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.