/

CVE-2026-100644

Severity:

HIGH RISK

(7.5)

SQL Injection (CWE-89) in SiYuan Graph Query Endpoint

CVE-2026-100644

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SiYuan before version 3.8.4 contains a SQL injection vulnerability in the graph query endpoint because the dailyNoteSavePath parameter is concatenated into a database query without adequate escaping or parameterization. On published sites with authentication disabled, an unauthenticated attacker may manipulate this parameter to retrieve arbitrary database rows from notebooks.

Affected context

The issue occurs in SiYuan deployments that expose the graph query endpoint and process the dailyNoteSavePath parameter as part of a SQL statement. Exploitation is more readily possible when a site is published with authentication disabled, allowing requests to reach the endpoint without an authenticated session.

Exploit preconditions

  • Attack surface: The published graph query endpoint
  • Required access: Network access to the endpoint; authentication may not be required when site authentication is disabled
  • Trigger point: Processing of the dailyNoteSavePath request parameter
  • Why exploitation is possible: User-controlled input is incorporated into SQL without sufficient parameterization or escaping, allowing query structure to be altered

Why this happens

The vulnerability results from constructing SQL statements by concatenating request-controlled data into the query text. This insecure pattern allows input to influence SQL syntax rather than being treated solely as a data value, mapping to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The flaw can permit unintended query operations, including set-based result combination, before authorization boundaries or output handling can contain the result.

Potential impact

  • An attacker may read arbitrary rows from accessible application databases
  • Notebook contents and related metadata could be disclosed
  • Sensitive information stored in other notebooks may be exposed
  • Retrieved data could support further attacks against users or connected services
  • Database integrity could be affected if additional query capabilities are reachable

General mitigation guidance

Mitigation generally focuses on ensuring that request data never becomes executable SQL syntax.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for all dynamic values
  • Prefer narrowly scoped query builders or data-access APIs over string-based SQL construction
  • Apply allowlisted validation for path-like parameters and enforce expected formats
  • Keep authentication enabled for published sites unless unauthenticated access is explicitly required
  • Enforce least-privilege database accounts with read and write permissions limited to necessary objects
  • Minimize sensitive data returned by graph and search endpoints
  • Centralize authorization and output filtering before database results are exposed

How teams detect issues like this

Detection approaches commonly include:

  • Static analysis rules identifying SQL strings built through concatenation or interpolation of request parameters
  • Code review checks for missing prepared statements around endpoint-controlled values
  • Dynamic testing with database-aware input variations in isolated environments
  • Web application firewall or API gateway policies for anomalous query-oriented input patterns
  • Monitoring for unusual graph endpoint usage, broad result volumes, and repeated requests from unauthenticated clients
  • Automated security review tools that flag CWE-89 patterns during CI analysis

Sources

SourceLink
github.comgithub.com/siyuan-note/siyuan/security/advisories/GHSA-xr4h-j7cg-q8pc
vulncheck.comvulncheck.com/advisories/siyuan-before-3.8.4-sql-injection-via-dailynotesavepath

Frequently asked

questions

It may be remotely exploitable when the graph query endpoint is publicly reachable, particularly on published sites with authentication disabled. The attacker still needs network access to an affected endpoint.

Not necessarily. The described exposure specifically includes unauthenticated access when site authentication is disabled; deployments with effective authentication and endpoint restrictions may reduce the attack surface.

The safest general pattern is to replace SQL string concatenation with parameterized queries or a constrained query abstraction, while validating parameters against the expected format.

Use secure database APIs by default, enforce least-privilege database access, keep authentication enabled for public deployments, and include SQL injection testing and static analysis in the development lifecycle.

Find out what's already
exploitable in your codebase.