# CVE-2026-116170: SiYuan SQL injection in history search

Source: https://junglewise.ai/threats/cve-2026-116170-siyuan-before-v3-8-7-contains-an-sql-injection-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-25. Updated: 2026-10-25  
License: CC BY 4.0 with a link back

CVE-2026-116170 · Severity: medium · CVSS 4.9 · Published 2026-10-25

SiYuan is an open-source note-taking application that maintains a searchable history database. An administrator with the API token can inject SQL commands via search parameters to exfiltrate deleted notes, including their content, titles, and file paths. This allows unauthorized disclosure of sensitive information that users intended to be permanently deleted.

Technologies: [SiYuan](https://junglewise.ai/threats/technologies/siyuan). Vendors: [SiYuan](https://junglewise.ai/threats/vendors/siyuan).

## Quick answers

**Is CVE-2026-116170 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-116170 being exploited in the wild.

**How severe is CVE-2026-116170?** Medium severity, with a CVSS score of 4.9, published 25 October 2026.

**Which products and versions are affected?** SiYuan before 3.8.7.

**Is there a fix for CVE-2026-116170?** Yes: fixed in v3.8.7. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-116170 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-116170?** Check whether you run 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.

## How to fix

- Fixed in v3.8.7

## Technical details

The history search endpoints in kernel/model/history.go concatenate the `op` and `query` parameters directly into SQL WHERE clauses without escaping when `type=3` (DocID search), then execute the result against history.db via raw SQL sinks with no validation. An authenticated admin (API token holder) can send UNION SELECT payloads to /api/history/searchHistory or /api/history/getHistoryItems to bypass filters and extract arbitrary history records.

## Affected products

- SiYuan SiYuan before 3.8.7

## Timeline

- 2026-10-09: disclosed
- 2026-10-25: advisory

## References

- [https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4hjx-84f6-gr7c](https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4hjx-84f6-gr7c)
- [https://www.vulncheck.com/advisories/siyuan-before-3.8.7-sql-injection-via-history-search-op-and-query](https://www.vulncheck.com/advisories/siyuan-before-3.8.7-sql-injection-via-history-search-op-and-query)

## 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 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)
- [SiYuan cleartext transmission via unenforced networkServeTLS setting](https://junglewise.ai/threats/cve-2026-116166-siyuan-3-6-0-before-3-8-7-accepts-and-persists-the)
