CVE-2026-101091 in SiYuan
Summary
by MITRE • 09/29/2026
SiYuan versions before v3.8.4 fail to properly validate SQL statements in block query embed blocks executed against siyuan.db. Attackers can craft malicious .sy documents with non-read-only SQL statements that execute automatically during background indexing, rendering, or export operations without authentication.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 09/29/2026
The vulnerability identified in SiYuan versions prior to v3.8.4 represents a critical security flaw rooted in the improper validation of Structured Query Language (SQL) statements within block query embed blocks. This application is designed as an open-source knowledge base and note-taking tool that relies heavily on local database operations, specifically utilizing siyuan.db for data persistence. The core technical failure lies in the application's handling of SQL queries embedded directly into document structures. When a user creates or edits a .sy file containing these embed blocks, the system is intended to execute specific read-only queries to display dynamic content within the note interface. However, due to insufficient input validation and sanitization mechanisms, the software fails to distinguish between legitimate read-only operations and potentially destructive write or administrative commands. This lack of strict enforcement allows attackers to inject arbitrary SQL statements that bypass expected operational constraints.
The exploitation vector for this vulnerability is particularly insidious because it does not require direct user interaction at the moment of execution in a traditional sense, nor does it demand authentication credentials from an attacker targeting the local instance. Instead, the attack relies on social engineering or document manipulation where a malicious .sy file is introduced to the victim's workspace. Once such a file containing crafted SQL payloads is opened, indexed, rendered, or exported by SiYuan, the application automatically processes these embedded blocks. During background indexing operations, which are common for maintaining search indexes and data consistency, or during rendering when displaying content, the database engine executes the malicious statements without verifying their intent or safety. This automatic execution context effectively grants the attacker a mechanism to run commands with the same privileges as the SiYuan process running on the user's machine.
The operational impact of this vulnerability is severe due to its potential for arbitrary code execution and data compromise through SQL injection techniques. Since the database operations are performed without authentication checks, an adversary can craft payloads that not only read sensitive information stored in siyuan.db but also modify or delete records, alter schema structures, or potentially leverage SQL features like UNION-based attacks to exfiltrate data from other tables if they exist within the same database instance. In more advanced scenarios involving specific SQLite configurations and extensions, this could lead to broader system compromise by writing files to disk or executing shell commands via built-in functions available in certain SQLite builds. The lack of authentication means that any user with access to open such a document can trigger these actions, making it a significant risk for collaborative environments or shared knowledge bases where documents are exchanged between users who may not fully trust the source material.
From a classification perspective, this vulnerability aligns closely with CWE-89 Improper Neutralization of Special Elements used in an SQL Command commonly known as SQL Injection. The failure to validate and sanitize user-controlled input before constructing database queries is the primary deficiency. Furthermore, within the context of the MITRE ATT&CK framework, this behavior can be associated with techniques involving data manipulation or persistence through malicious documents, specifically falling under categories related to client-side exploitation where a trusted application is tricked into executing unintended commands. The automatic execution during background processes also touches upon aspects of supply chain integrity if such files are distributed via plugins or shared repositories, although the primary vector here remains local document processing.
To mitigate this risk, users must immediately upgrade SiYuan to version v3.8.4 or later where these validation checks have been implemented and strengthened. Until an update is applied, it is advisable to exercise extreme caution when opening .sy documents from untrusted sources. Disabling automatic background indexing for external files if possible can reduce the window of exposure during document processing. Additionally, implementing strict input filtering at the application level to ensure that only whitelisted read-only SQL operations are permitted within embed blocks would prevent the execution of write or administrative commands. Security audits should focus on verifying that all database interactions originating from user-generated content undergo rigorous sanitization and type checking before being passed to the underlying SQLite engine, ensuring that the principle of least privilege is maintained for application processes handling untrusted data inputs.