CVE-2026-116170 in SiYuan
Summary
by MITRE • 10/25/2026
SiYuan before v3.8.7 contains an sql injection vulnerability that allows admin-token holders to read history.db by injecting unescaped op and type=3 query values. Attackers can send crafted UNION SELECT payloads to searchHistory or getHistoryItems endpoints to exfiltrate deleted document content, titles, and paths.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 10/25/2026
The SiYuan note-taking application prior to version 3.8.7 is affected by a critical SQL injection vulnerability that compromises the integrity of its local database storage mechanism. This flaw specifically impacts users with administrative privileges who possess valid admin tokens, allowing them to interact with internal endpoints such as searchHistory and getHistoryItems. The root cause lies in the improper handling of input parameters, particularly the op parameter combined with type=3 query values, which are not adequately sanitized before being incorporated into SQL queries executed against the history.db file. This lack of validation enables attackers to inject arbitrary SQL commands that bypass intended logic controls within the application's backend processing layer.
The technical exploitation of this vulnerability involves crafting specific UNION SELECT payloads designed to extract data from tables other than those originally queried by the legitimate function. By manipulating the input parameters, an attacker can force the database engine to return additional rows containing sensitive information stored in the history.db file. This file typically retains records of deleted documents, including their full content, titles, and associated paths. Consequently, even after a user has intentionally removed notes from their active workspace, these artifacts remain accessible through this injection vector, effectively negating the intended data deletion process and preserving forensic traces that should have been purged.
The operational impact of this vulnerability is significant for users who rely on SiYuan for storing sensitive or confidential information. The ability to exfiltrate deleted document content means that privacy expectations are violated, as historical data remains retrievable by anyone with administrative access tokens. This poses a severe risk in collaborative environments where multiple administrators might have access, or if an admin token is compromised through other vectors such as phishing or session hijacking. Furthermore, the exposure of file paths and titles can aid attackers in mapping out the user's organizational structure and identifying additional targets for further exploitation within the local system environment.
From a classification perspective, this vulnerability aligns with CWE-89 Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL Injection. The attack pattern corresponds to ATT&CK technique T1074 Data Staged or T1530 Data from Local System depending on the final exfiltration method, but primarily represents a local data access violation where stored information is retrieved without authorization. It highlights the importance of secure coding practices in desktop applications that interact with local databases, ensuring that all user-supplied input undergoes rigorous validation and parameterization before execution.
To mitigate this risk, users must upgrade to SiYuan version 3.8.7 or later immediately upon availability. The developers have addressed the underlying issue by implementing proper input sanitization and using prepared statements for database queries involving history retrieval operations. In addition to upgrading, administrators should enforce strict access controls over admin tokens and consider rotating credentials if there is any suspicion of prior exploitation. Regular audits of application logs can also help detect attempts to exploit this vulnerability before significant data loss occurs. Maintaining up-to-date software versions remains the most effective defense against known vulnerabilities in widely used productivity tools.