Executive brief
SiYuan is a note-taking and knowledge management application that supports publishing documents with access controls. Three API endpoints fail to enforce publish-access restrictions, allowing anonymous readers or low-privilege published-document viewers to discover the complete database column schema (including sensitive labels and template logic) and enumerate block IDs across the entire workspace, including from documents that should be hidden or password-protected. An attacker can use this information to pivot to restricted databases and retrieve their contents via other endpoints.
Technical details
The vulnerability comprises three missing authorization checks in SiYuan's kernel API handlers. First, `POST /api/av/getAttributeViewKeysByID` returns the full column schema of any database (names, descriptions, select-option vocabularies, template expressions, relation targets) without applying the `FilterBlockAttributeViewKeysByPublishAccess` check that its sibling endpoint `getAttributeViewKeys` correctly enforces. Second and third, `POST /api/block/getBlockDefIDsByRefText` and `POST /api/block/getBlockRelevantIDs` enumerate valid block IDs workspace-wide—including from private and password-protected documents and encrypted notebooks while unlocked—with no publish-access filtering. All three endpoints are registered with `CheckAuth`-only, making them reachable by anonymous users (when `Publish.Auth.Enable` is false) and any publish `RoleReader` token. The root cause is absent authorization guards in the handler bodies at `kernel/api/av.go` (line 548) and `kernel/api/block.go` (lines 237, 274). An attacker can harvest valid database and block IDs, then use other endpoints to fetch sensitive metadata and content. Patches are available in commits 931ba69 and f36331956ae9.
Affected products
- SiYuan SiYuan < 0.0.0-20260724103335-f36331956ae9
Timeline
- 2026-09-03: disclosed: Advisory published to GitHub Advisory Database
- 2026-07-24: patched: Fix released in commit 0.0.0-20260724103335-f36331956ae9