# SiYuan SQL injection in backlink/mention search

Source: https://junglewise.ai/threats/siyuan-sql-injection-in-backlink-mention-search-9ca0d701  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-14. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: critical · CVSS 10 · Published 2026-08-14

SiYuan is a popular note-taking and knowledge management application that allows users to organize and search documents. A critical SQL injection vulnerability in the backlink/mention search feature allows attackers to execute arbitrary SQL commands against the application's database, potentially exposing or modifying sensitive notes across all notebooks. An anonymous user or one with minimal read permissions can exploit this via a specially crafted search query, or via malicious document titles shared with victims.

Technologies: [github.com/siyuan-note/siyuan/kernel (Go)](https://junglewise.ai/threats/technologies/github-com-siyuan-note-siyuan-kernel), [SiYuan](https://junglewise.ai/threats/technologies/siyuan). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [SiYuan](https://junglewise.ai/threats/vendors/siyuan).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Critical severity, with a CVSS score of 10, published 14 August 2026.

**Which products and versions are affected?** github.com/siyuan-note/siyuan/kernel (Go) < 3.7.4; SiYuan <= 3.7.2.

**Is there a fix for This vulnerability?** A patch was published on 2026-08-14: Patch released in v3.7.4 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run github.com/siyuan-note/siyuan/kernel (Go) or SiYuan at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is a second-order SQL injection (CWE-89) in the backlink/mention search functionality. The root cause lies in the MATCH query construction in kernel/model/backlink.go, which concatenates stored block metadata (title, name, alias, anchor text) and client-supplied keywords without properly escaping single quotes—only double quotes are escaped. While the indexing code uses parameterized INSERTs to safely store metadata, the query reuse path concatenates these values directly into SQL. An attacker can inject a single quote to break out of the string literal and inject arbitrary SQL. The first-order vector requires only anonymous or RoleReader access (reachable via publish mode). The second-order vector exploits stored document metadata that detonates when that document is later queried by any user. Because the query executes on the global read-write siyuan.db handle through a statement-stacking-capable SQLite driver, attackers can stack multiple statements to achieve cross-notebook read disclosure, writes, and schema modifications. The fix, released in v3.7.4, requires parameterizing the keyword and metadata bindings rather than concatenating them.

## Affected products

- SiYuan SiYuan <= 3.7.2

## Timeline

- 2026-07-23: disclosed: Original advisory GHSA-q2vg-7qgx-x5fc published
- 2026-08-14: advisory: Duplicate advisory GHSA-p8cp-78hp-wmq8 published; CVE-2026-72811 issued
- 2026-08-14: patched: Patch released in v3.7.4
- 2026-09-03: other: Duplicate advisory GHSA-p8cp-78hp-wmq8 withdrawn

## References

- [https://github.com/siyuan-note/siyuan/security/advisories/GHSA-q2vg-7qgx-x5fc](https://github.com/siyuan-note/siyuan/security/advisories/GHSA-q2vg-7qgx-x5fc)
- [https://www.vulncheck.com/advisories/siyuan-before-sql-injection-via-backlink-search](https://www.vulncheck.com/advisories/siyuan-before-sql-injection-via-backlink-search)

## Related threats

- [SiYuan path traversal in web fetch](https://junglewise.ai/threats/cve-2026-126776-siyuan-3-7-0-before-3-8-10-on-windows-contains-a-path-traversal)
- [SiYuan publish filter information disclosure in local storage](https://junglewise.ai/threats/go-2026-6836-siyuan-the-publish-filter-for-local-storage-returns-the-7f022e62)
- [SiYuan path traversal via GLOBALROOT alias bypass](https://junglewise.ai/threats/cve-2026-118680-siyuan-3-8-7-through-3-8-8-fails-to-normalize-windows-globalroot)
- [SiYuan SQL injection in history search](https://junglewise.ai/threats/cve-2026-116170-siyuan-before-v3-8-7-contains-an-sql-injection-vulnerability)
- [SiYuan cross-site scripting in /check-auth redirect](https://junglewise.ai/threats/cve-2026-116167-siyuan-from-2-9-0-before-3-8-7-contains-a-cross-site-scripting)
