CVE-2026-29073
Unauthorized SQL Query Execution in SiYuan Prior to
Publication date: 2026-03-06
Last updated on: 2026-03-10
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| b3log | siyuan | to 3.5.9 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-89 | The product 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 a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. |
| CWE-862 | The product does not perform an authorization check when an actor attempts to access a resource or perform an action. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-29073 is a vulnerability in the SiYuan personal knowledge management system versions prior to 3.6.0. It occurs because the /api/query/sql endpoint allows any logged-in user, including those with only Reader-level privileges, to execute arbitrary SQL queries directly on the database.
This happens because the endpoint only checks for basic authentication (i.e., whether the user is logged in) but does not verify if the user has administrative rights or proper authorization to run SQL commands.
Technically, the vulnerable function accepts a JSON payload containing a SQL statement and executes it without any restrictions or validation, enabling users to run queries such as listing all database tables or extracting sensitive user content.
This vulnerability is classified as a combination of SQL Injection (CWE-89) and Missing Authorization (CWE-862). It was fixed in version 3.6.0 of SiYuan.
How can this vulnerability impact me? :
This vulnerability can have a significant impact because any authenticated user, even those with minimal privileges, can access and manipulate the entire database.
- Unauthorized access to all data stored in the database, including sensitive user notes and content.
- Potential data corruption or deletion if malicious SQL write commands are executed.
- Severe performance degradation caused by executing expensive or harmful SQL queries.
- Loss of data confidentiality and integrity due to improper authorization checks.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
I don't know
How can this vulnerability be detected on my network or system? Can you suggest some commands?
[{'type': 'paragraph', 'content': 'This vulnerability can be detected by testing whether a logged-in user with Reader-level privileges can execute arbitrary SQL queries via the /api/query/sql endpoint.'}, {'type': 'paragraph', 'content': 'Proof-of-concept commands involve sending POST requests with SQL queries to the vulnerable API endpoint to check if unauthorized SQL execution is possible.'}, {'type': 'list_item', 'content': "List all database tables: `SELECT name, type FROM sqlite_master WHERE type='table'`"}, {'type': 'list_item', 'content': 'Extract user content: `SELECT id, content FROM blocks`'}] [1]
What immediate steps should I take to mitigate this vulnerability?
The immediate mitigation step is to upgrade the siyuan-note application to version 3.6.0 or later, where this vulnerability has been patched.
Until the upgrade is applied, restrict access to the /api/query/sql endpoint to only trusted administrative users or disable it if possible.
Additionally, monitor and audit API usage to detect any unauthorized SQL query attempts by users with Reader-level privileges.