SiYuan Personal Knowledge Management System SQL Injection Vulnerability Allowing Unauthorized Database Access

Vulnerability

A vulnerability in SiYuan personal knowledge management system prior to version 3.6.0 allows logged-in users, including those with reader privileges, to execute arbitrary SQL queries directly on the database via the /api/query/sql endpoint. This endpoint only verifies basic authentication and not administrative rights, leading to an authorization bypass. The issue has been patched in version 3.6.0.

Impact

Exploitation of this vulnerability allows reader-level users to access and query all database information, including notes from other users. The SQL injection could also be used to perform write operations, despite the API being intended for read-only queries, potentially causing significant performance problems.

Reproduction

To reproduce this vulnerability, log in as a user with reader privileges and send a POST request to the /api/query/sql endpoint. Include a JSON payload with the SQL statement to be executed. The request must be authenticated with basic auth using the reader user's credentials.

Remediation

Users are advised to update to SiYuan version 3.6.0 or later.

Added: Mar 6, 2026, 8:22 AM
Updated: Mar 6, 2026, 8:22 AM

Vulnerability Rating

Custom Algorithm
spread
0.3
impact
5.0
exploitability
6.2
remediation
7.7
relevance
3.5
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.