Executive brief
SiYuan is a note-taking and knowledge management application. A path traversal vulnerability in its attribute-view endpoints allows authenticated users with reader permissions (or anonymous users when authentication is disabled) to read JSON database files outside the intended storage directory, potentially disclosing sensitive information from other notebooks or scopes they should not access.
Technical details
The vulnerability is a path traversal (CWE-22) in four attribute-view read endpoints: /api/av/renderAttributeView, /api/av/getAttributeViewKeysByID, /api/av/getAttributeViewKeys, and /api/av/getCurrentAttrViewImages. These endpoints construct filesystem paths from a caller-controlled avID parameter without proper validation. The root cause is that identifier validation (ast.IsNodeIDPattern) only occurs in the file-creation code branch within model.RenderAttributeView; when an avID referencing an existing file outside the intended DataDir/storage/av/ directory is supplied, the validation is bypassed and the file is read unconditionally via av.ParseAttributeView(). The endpoints are gated only by CheckAuth (not admin role checks), allowing access via the publish service's RoleReader token or anonymously when Publish.Auth.Enable is false. An attacker can exploit this by supplying an avID containing ../ path segments to read arbitrary .json files in the workspace and disclose attribute-view (database) content from other scopes/notebooks. The fix is to validate avID before path construction on all branches or to confine the loaded path at the sink level to ensure it stays within the avBaseDir.
Affected products
- siyuan-note siyuan < 3.7.3
Timeline
- 2026-07-20: disclosed
- 2026-08-03: advisory: GHSA-x7jr-gvvr-p9w7 published as duplicate; original advisory GHSA-7hm9-v7vf-7g4w is the authoritative source
- 2026-09-03: other: GHSA-x7jr-gvvr-p9w7 withdrawn as duplicate of GHSA-7hm9-v7vf-7g4w