Mar 14, 2026·5 min read·60 visits
A missing authorization check in SiYuan's `renderSprig` API endpoint allows low-privileged authenticated users to execute arbitrary SQL queries via malicious templates, exposing all workspace data.
SiYuan versions prior to 3.6.1 contain an improper authorization vulnerability in the template rendering API. An authenticated attacker can exploit a missing access control check to execute arbitrary SQL queries against the local workspace database, leading to high-impact information disclosure.
SiYuan is a personal knowledge management system that utilizes a local SQLite database to store user workspaces, notes, metadata, and custom attributes. The application exposes an administrative API to facilitate various backend operations, including the evaluation of templates via the Sprig library. This template engine is designed to allow administrators to dynamically generate content and query the underlying data structures.
CVE-2026-32704 is an improper authorization vulnerability (CWE-285) located in the POST /api/template/renderSprig endpoint. This specific route handles the parsing and execution of Sprig templates submitted via HTTP requests. The vulnerability arises because the endpoint fails to verify whether the requesting user possesses administrative privileges before processing the template.
Consequently, the application processes the template using the privileges of the application process itself. Since the SiYuan template engine explicitly exposes a SQL function to the template context, an authenticated attacker can leverage this endpoint to interact directly with the backend SQLite database.
The root cause of CVE-2026-32704 lies in the omission of the standard authorization middleware or check function on the renderSprig API route. In the SiYuan codebase, administrative endpoints are expected to invoke model.CheckAdminRole to validate the authorization token and role of the incoming request. This function ensures that only highly privileged users can access sensitive backend features.
The renderSprig endpoint was deployed without this crucial model.CheckAdminRole invocation. When an HTTP POST request reaches the route, the application only verifies that the request contains a valid authentication token, satisfying the low-privilege requirement. It then proceeds to pass the user-supplied JSON payload directly to the Sprig template rendering engine.
The Sprig environment configured by SiYuan includes custom functions tailored for workspace management. One of these functions, typically exposed as sql, accepts a raw SQL query string, executes it against the local SQLite database, and returns the result set to the template context. Because the authorization check is absent, any authenticated user can successfully invoke this powerful internal function.
Exploitation of CVE-2026-32704 requires the attacker to possess valid credentials or an authentication token for a non-administrative account on the target SiYuan instance. Network access to the application's API interface is also necessary. The attack vector relies entirely on standard HTTP requests, requiring no specialized tools beyond an HTTP client.
The attacker crafts a POST request to /api/template/renderSprig with a JSON body containing the template key. The value of this key contains the malicious Sprig payload. By utilizing the pipeline operator (|) in the template syntax, the attacker passes an arbitrary SQL query string into the sql function exposed by the engine.
POST /api/template/renderSprig HTTP/1.1
Host: [siyuan-host]
Authorization: Token [user-token]
Content-Type: application/json
{
"template": "{{ \"SELECT * FROM blocks LIMIT 5\" | sql }}"
}Upon processing the request, the backend evaluates the template, executes the embedded SELECT statement, and serializes the result. The application returns this data within the HTTP response body. An attacker can systematically query the database schema and exfiltrate all tables by altering the SQL payload in subsequent requests.
The vulnerability carries a CVSS v3.1 score of 6.5 (Medium severity), calculated with the vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N. The primary impact is a total loss of confidentiality for the data stored within the SiYuan workspace. The attack vector is network-based and involves low complexity, making it highly reproducible.
An attacker successfully exploiting this vulnerability gains read access to the entire SQLite database. This exposes all user notes, sensitive metadata, custom attributes, and application configuration settings. If the workspace contains proprietary information, credentials, or personal data, the exposure represents a severe security breach.
The CVSS vector indicates no impact on integrity or availability. The exposed SQL function within the template engine is typically restricted to data retrieval operations, preventing the execution of INSERT, UPDATE, or DELETE statements. However, the exact limitations depend on the underlying SQLite connection configuration and the specific implementation of the sql helper function.
The vendor addressed CVE-2026-32704 in SiYuan version 3.6.1. The patch introduces the missing model.CheckAdminRole validation within the handler for the /api/template/renderSprig endpoint. This ensures that the application verifies administrative privileges before passing the request body to the template engine, effectively closing the unauthorized access vector.
Organizations operating SiYuan instances must upgrade to version 3.6.1 or later immediately. As an interim mitigation, administrators should ensure that SiYuan instances are strictly isolated from untrusted networks. Deploying a reverse proxy equipped with an external identity provider (e.g., OIDC) can restrict baseline access to the application, reducing the available attack surface.
Security teams can detect exploitation attempts by monitoring application and reverse proxy logs. A high volume of requests to the /api/template/renderSprig endpoint from standard user accounts indicates suspicious activity. Additionally, Web Application Firewalls (WAF) can be configured to inspect the template parameter in POST requests for common SQL keywords, providing an active defense layer against exfiltration payloads.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
SiYuan siyuan-note | < 3.6.1 | 3.6.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-285 |
| Attack Vector | Network |
| CVSS Score | 6.5 |
| Impact | High Confidentiality |
| Exploit Status | Proof of Concept Available |
| Authentication | Required (Low Privilege) |
The software does not perform or incorrectly performs an authorization check when an actor attempts to access a resource.
A local elevation of privilege vulnerability exists in the Microsoft .NET Aspire CLI (`Aspire.Cli`) versions 13.5.4 prior to 13.6.5. When executing SDK management commands (`aspire sdk generate`, `aspire sdk dump`, and `aspire sdk export`), the CLI creates temporary project directories inside the shared operating system temporary folder (such as `/tmp` on Unix-like systems) without restricting directory permissions or disabling MSBuild automatic response file resolution. A local, low-privileged attacker on a multi-user system can place a crafted `Directory.Build.rsp` file in the shared temporary directory hierarchy. When a victim user executes an affected Aspire CLI command, MSBuild traverses upward, ingests the attacker-controlled response file, and executes arbitrary commands in the security context of the victim user.
CVE-2026-120792 is a high-severity local information disclosure vulnerability in the Microsoft .NET Aspire CLI (Aspire.Cli) affecting versions 13.5.4 prior to 13.6.5. The flaw stems from the insertion of sensitive information into a shared temporary log file (CWE-532) combined with insecure temporary file creation (CWE-377) within the DeprecatedMcpCommandScanner component. During agent configuration scanning, the CLI unconditionally appends internal workspace paths and the first 200 characters of Model Context Protocol (MCP) agent configuration files to a statically named file in the system temporary directory. On multi-user systems, unprivileged local users can read this file to harvest API keys, authentication tokens, and internal service endpoints.
CVE-2026-114159 is a heap-based buffer overflow vulnerability (CWE-122) in Microsoft.DiaSymReader.Native affecting Microsoft Visual Studio and the .NET Runtime on Windows. An integer truncation error during the parsing of oversized document names in Portable PDB symbol files causes an undersized heap allocation, leading to an out-of-bounds memory write and remote code execution.
CVE-2026-114158 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple supported servicing branches of Microsoft .NET (.NET 8.0, 9.0, 10.0, and 11.0) on Windows. The flaw resides in the native symbol reader library, Microsoft.DiaSymReader.Native, and is triggered when parsing Portable Program Database (PDB) metadata containing malformed EmbeddedSource custom debug information records. By supplying a parent Record Identifier (RID) of zero or an out-of-bounds value, an attacker causes an integer underflow during 1-based to 0-based index conversion, leading to a heap-based buffer overflow and arbitrary code execution within the context of the host developer tool or runtime.
CVE-2026-114151 is a high-severity remote code execution vulnerability affecting Microsoft Visual Studio 2026 and multiple supported versions of the Microsoft .NET runtime on Windows. The flaw resides in the native Debug Information Access (DIA) symbol reader component, Microsoft.DiaSymReader.Native. When parsing Program Database (.pdb) files, the component fails to validate the length of serialized numeric records (specifically LF_DECIMAL structures) before unpacking them into a fixed-size stack buffer. An attacker who convinces a user or automated diagnostic process to load a crafted .pdb file can trigger a stack-based buffer overflow, resulting in arbitrary code execution within the context of the host process.
CVE-2026-105544 is a high-severity local elevation of privilege vulnerability in Microsoft .NET and Microsoft.TestPlatform.CLI. Improper access control on local inter-process communication mechanisms and execution brokers allows an authorized local attacker to cross security boundaries and execute arbitrary code in the context of a higher-privileged user running a test execution cycle.