Horizon Alert
Summary of the vulnerability and why it matters
A vulnerability in SiYuan's search functionality could allow an attacker to access and modify sensitive data within non-encrypted notebooks if the system is configured with specific publishing settings. This issue impacts the integrity and confidentiality of stored information.
- Attackers can alter or steal data from notebooks.
- Confidentiality and integrity of data are at risk.
- Confirm exposure and impact on your data.
Attack Path
How an attacker could exploit the issue
An attacker can target the searchDocs API endpoint, which is exposed externally and accessible either anonymously or with limited privileges. By sending a specially crafted keyword to this endpoint, an attacker can inject malicious SQL commands. This can lead to unauthorized access and modification of data stored in all non-encrypted notebooks within the SiYuan instance.
- Unauthenticated or limited user access.
- Keyword parameter in API call.
- Read and modify database content.
Live Threat
Current exploitation, exposure, and threat context
This vulnerability could affect all cleartext notebooks on an instance when an attacker can access the `/api/filetree/searchDocs` endpoint. This endpoint is reachable unauthenticated when publish mode is enabled with specific configurations, or with a publish RoleReader token, allowing the attacker to execute SQL statements.
- Database content on all notebooks at risk.
- Direct SQL injection via API endpoint.
- Read and modify all cleartext notebook data.
Operational Fix
Recommended remediation, mitigation, and detection steps
The SQL injection vulnerability in the searchDocs endpoint affects SiYuan instances, potentially impacting data integrity and confidentiality. Owners of the SiYuan application, along with infrastructure and security teams, are likely responsible for addressing this. The first practical step is to identify all SiYuan instances, determine their exposure and business criticality, and then plan remediation.
- Identify SiYuan instances and accountable owners.
- Verify instance reachability and business criticality.
- Plan remediation based on identified risk.