Skip to main content

SiYuan CVE-2026-116170

| EUVDEUVD-2026-109431 MEDIUM
SQL Injection (CWE-89)
2026-10-25 VulnCheck GHSA-hf8g-c9wm-2xp9
6.9
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain admin token (local config or login flow)
  2. Delivery
    Craft UNION SELECT in op/type=3 query
  3. Exploit
    POST to searchHistory/getHistoryItems
  4. Execution
    Unescaped SQL executes on history.db
  5. Impact
    Exfiltrate deleted document content, titles, paths

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires a valid SiYuan admin API token - the attacker must already hold admin credentials, obtain the token from the workspace config (ws/conf/conf.json), complete the login flow, or run as/within a client that has the token (e.g. a malicious plugin or the MCP history tool). The vulnerable path is reached via POST /api/history/searchHistory or /api/history/getHistoryItems: the op field is always injectable, while query is injectable only when type=3 (search-by-doc-ID), because the stringQuery escaping is deliberately skipped for that type. There is no non-default feature toggle - the behavior exists in all builds <= 3.8.6. The limiting factor is the admin-token requirement (PR:H); this is not remote-unauthenticated and does not affect integrity or availability, as the sink is read-only against history.db.

Impact

This is a genuine but constrained issue, best characterized as a privileged, read-only data-exfiltration flaw rather than a drive-by compromise. The supplied CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N) is internally consistent with the GHSA evidence: exploitation is network-reachable and low-complexity, but requires high privileges (PR:H) because every affected endpoint (searchHistory, getHistoryItems, the MCP history tool) is admin-token-gated per api/router.go:236-237. Impact is confidentiality-only (VC:H, VI:N/VA:N) - a read-only UNION SELECT against history.db exposing deleted document content, titles and paths - which the score of 6.9 (Medium) reflects fairly. The vuln.today Decision label is 'this_month', indicating a prioritized-but-not-emergency fix cadence, consistent with the PR:H gating. The GHSA advisory includes a detailed, author-verified PoC (run live against a source-built v3.8.6 kernel), so working exploitation technique is public; this raises likelihood for anyone who can present an admin token (including a malicious plugin). No EPSS score is provided and the CVE is not listed in CISA KEV, so there is no evidence of active in-the-wild exploitation - the realistic threat is a malicious/compromised plugin or a leaked admin token, not mass internet-facing attack. Net: a real, patch-this-month priority for SiYuan operators, but the PR:H prerequisite keeps it below critical.

Exploit ScenarioDerived

An attacker who already holds (or tricks a user into installing a plugin that holds) a SiYuan admin token sends a crafted POST to /api/history/getHistoryItems with type=3 and a query such as x' UNION SELECT id,type,op,title,content,path,created FROM histories_fts_case_insensitive --, which is concatenated unescaped into the SQL executed against history.db. This exfiltrates bulk document history - including previously deleted document content, titles and paths - beyond what the structured API exposes. A detailed, author-verified PoC for this exact sequence is published in the GHSA advisory.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 25, 2026

SQL injection in the SiYuan note-taking kernel's history search handlers (all builds up to and including v3.8.6) lets anyone holding a valid admin API token read the contents of history.db beyond what the history API is meant to expose, including content, titles and paths of previously deleted documents. The flaw is privileged rather than remote-unauthenticated: the actor must already possess the workspace admin token, obtain it from ws/conf/conf.json, complete the login flow, or operate inside a client that holds it, such as a malicious plugin or the MCP history tool. Impact is read-only confidentiality loss against history.db - no integrity or availability effect - and the vendor advisory ships a reproduction that was validated against a source-built v3.8.6 kernel; no confirmed active exploitation (CISA KEV) was reported and the priority label is this_month.

RemediationAI

Upgrade to SiYuan v3.8.7, the vendor-released fixed version, which escapes op and query (stringQuery applied for all types, quote-doubling) in buildSearchHistoryQueryFilter and adds CheckSingleStatement plus CheckReadonlyStatement to sql.QueryHistory and sql.SelectHistoriesRawStmt, mirroring the sql/block_query.go hardening; see the advisory at https://github.com/siyuan-note/siyuan/security/advisories/GHSA-4hjx-84f6-gr7c. Where upgrading is not immediately possible, the practical compensating controls all target the admin-token prerequisite: keep the kernel API off untrusted networks and do not expose it to the internet (trade-off: breaks remote/mobile sync clients that rely on direct API access), rotate the api.token in ws/conf/conf.json and restrict read access to that file, since anyone who can read it can exploit the sink (trade-off: invalidates existing clients and automation until they are reconfigured), and audit or remove third-party plugins and MCP history-tool integrations that hold the token, as they inherit full exploitation capability (trade-off: loss of functionality those extensions provide). Because the injection is read-only against history.db, none of these workarounds prevent a token holder from reading deleted document content once they have the credential.

Affected VersionsENISA

SiYuan 0 <3.8.7

Affected Packages

euvd siyuan fix: 3.8.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

SiYuan is a Go-based personal knowledge base whose kernel exposes an HTTP API; history is stored in a separate SQLite database (history.db) with an FTS table (histories_fts_case_insensitive in the published UNION payload). The root cause is CWE-89: in kernel/model/history.go, buildSearchHistoryQueryFilter concatenates two request-controlled values into SQL string literals - the id clause from query when type==3 (search-by-doc-ID) and the op clause - and the stringQuery escaping is deliberately skipped for type 3, leaving both sinks unescaped. The resulting statement is executed by sql.QueryHistory and sql.SelectHistoriesRawStmt with no single-statement or read-only validation, unlike the block-query sinks in sql/block_query.go which were hardened with checkRawBlockQueryStmt by GHSA-67p9-hm94-xwf3. This is a sibling gap of the earlier SQLi fixes GHSA-336w-67gx-gx2h (search) and GHSA-5rwv-4j4c-f954 / GHSA-xr4h-j7cg-q8pc (graph). Reachable routes are admin-gated (api/router.go): POST /api/history/searchHistory and POST /api/history/getHistoryItems, plus the MCP history tool. Because the sink is read-only against history.db, confidentiality is the only impacted property, but the missing guard also leaves the sink unhardened against future write or stacked-statement changes.

Know when Siyuan gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
vuln.today AI 4.9 MEDIUM

All endpoints are admin-token-gated (PR:H), reachable over the network at low complexity with no user interaction; impact is read-only data exfiltration so C:H, I:N, A:N.

3.1 AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Oct 25, 2026 - 14:01 EUVD

DescriptionCVE.org

SiYuan before v3.8.7 contains an sql injection vulnerability that allows admin-token holders to read history.db by injecting unescaped op and type=3 query values. Attackers can send crafted UNION SELECT payloads to searchHistory or getHistoryItems endpoints to exfiltrate deleted document content, titles, and paths.

Threat Intelligence Overview

EPSS Score
0.4%
Top 70% exploitable
Prevalence
Low
self-hosted open-source personal note app, niche footprint, not enterprise-deployed
Social Media
1
Sightings
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

More in Siyuan

View all
CVE-2026-69083 CRITICAL POC
9.9 Aug 03

SQL injection in SiYuan's fullTextSearchAssetContent endpoint lets unauthenticated attackers and holders of publish Role

CVE-2026-54067 CRITICAL POC
9.9 Jun 24

Stored cross-site scripting in SiYuan personal knowledge management before 3.7.0 lets an attacker with write access to a

CVE-2026-69084 CRITICAL POC
9.9 Aug 03

SQL injection in SiYuan personal knowledge management (versions <= v3.7.2) lets attackers pass arbitrary SQL statements

CVE-2026-54158 CRITICAL POC
9.9 Jun 24

Stored cross-site scripting in SiYuan's attribute-view (database) cell renderer, affecting all versions prior to 3.7.0,

CVE-2026-69085 CRITICAL POC
9.9 Aug 03

SQL injection in SiYuan personal knowledge-management software (all versions before v3.7.3) lets attackers inject arbitr

CVE-2024-53507 CRITICAL POC
9.8 Nov 29

A SQL injection vulnerability was discovered in Siyuan 3.1.11 in /getHistoryItems. Rated critical severity (CVSS 9.8), t

CVE-2024-53506 CRITICAL POC
9.8 Nov 29

A SQL injection vulnerability has been identified in Siyuan 3.1.11 via the ids array parameter in /batchGetBlockAttrs. R

CVE-2024-53505 CRITICAL POC
9.8 Nov 29

A SQL injection vulnerability has been identified in Siyuan 3.1.11 via the id parameter at /getAssetContent. Rated criti

CVE-2024-53504 CRITICAL POC
9.8 Nov 29

A SQL injection vulnerability has been identified in Siyuan 3.1.11 via the notebook parameter in /searchHistory. Rated c

CVE-2026-23852 CRITICAL POC
9.6 Jan 19

SiYuan personal knowledge management system prior to 3.5.4 has a stored XSS vulnerability (CVSS 9.6) that allows code ex

CVE-2026-56397 CRITICAL POC
9.4 Jun 21

Remote code execution in SiYuan note-taking application (before v3.6.1) allows any malicious Bazaar marketplace package

CVE-2026-54069 CRITICAL POC
9.2 Jun 24

Origin-validation bypass in SiYuan Note (open-source personal knowledge management) before 3.7.0 lets any installed Chro

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy