CriticalBreach
SiYuan: Unauthenticated SQL injection in searchDocs via unescaped keyword (publish mode): cross-notebook read/write with statement stacking
GitHub Security Advisories·Source published ·1 min read
What happened?
Summary The /api/filetree/searchDocs endpoint concatenates the caller-supplied search keyword directly into a SQL statement with no escaping and no parameter binding. The endpoint is gated by CheckAuth only reachable by the publish RoleReader token, and by the anonymous account when Publish.Auth.Enable is false.
Key details
- The /api/filetree/searchDocs endpoint concatenates user-supplied search keywords directly into SQL without escaping or parameter binding.
- The endpoint is reachable by unauthenticated users when Publish.Auth.Enable is false or by any publish RoleReader token.
- The vulnerable query targets the global blocks table spanning all opened non-encrypted notebooks, enabling cross-notebook read and write.
- Existing statement guards CheckSingleStatement and CheckReadonlyStatement are not called on the searchDocs query path.
- A proof of concept demonstrates unauthenticated SQL injection disclosing sqlite_version() via UNION SELECT through the search response.
What is affected?
- SiYuan kernel versions before 0.0.0-20260721043339-eef10568384e are affected.
How do I fix or mitigate it?
- Patched version 0.0.0-20260721043339-eef10568384e addresses the vulnerability.
Summarised by SecOraLens from GitHub Security Advisories. Always read the original source before acting. How SecOraLens verifies advisories.
What to do next
Hunt for this in your environmentPick a hypothesis, see where it sits on the MITRE ATT&CK model and get ready-to-run Sigma, Splunk, Sentinel and Elastic queries. Free to try.Open the Threat-Hunt Workbench →Get advisories like this by emailNew advisories delivered as they publish, each traced to its original source. Unsubscribe any time.Subscribe →Using this for a team?Paid plans add detection content, the full workbench and archive search. Not sure which fits? Ask us for a walkthrough.See plans →
For CISOs and SOC leads
Brief your board. Brief your team.
Executive risk briefs for governance, technical kill-chains for the SOC — delivered as advisories publish. Critical alerts within 1 hour. No spam, unsubscribe anytime.
