SiYuan Publish Reader Path Traversal via removeUnusedAttributeView
A path traversal vulnerability exists in SiYuan's publish service via the `/api/av/removeUnusedAttributeView` endpoint, allowing a publish-service Reader to delete arbitrary `.json` files under the workspace path reachable from `data/storage/av/` using traversal payloads.
Triage facts
Revision 2- Evidence
- Unknown
- Severity
- High
- Sources
- 1 public source
- Freshness
- Revision 2Apr 11, 12:00 UTC
- Detection
- 2 rules
Revision history 1 entry · Revision 2
- Revision 2
Repaired a legacy canonical identity collision
Changed: slug
SiYuan, a note-taking application, is vulnerable to a path traversal attack through its publish service. The vulnerability lies in the /api/av/removeUnusedAttributeView endpoint, which can be accessed by users with RoleReader permissions. Publish requests are forwarded upstream with a valid JWT, bypassing intended access controls. The removeUnusedAttributeView handler accepts an attacker-controlled id parameter without proper validation and uses it in a file system delete operation. This allows attackers to use "../" sequences to traverse directories and delete arbitrary .json files within the SiYuan workspace. This vulnerability was disclosed on 2026-04-10 and impacts versions prior to the fix. Successful exploitation can lead to persistent destruction of Attribute View definitions, deletion of global workspace configuration, corruption of user state, and broken UI behavior.
Attack Chain
- Attacker gains publish-reader access, or anonymous publish access if publish auth is disabled.
- Attacker crafts a malicious POST request to
/api/av/removeUnusedAttributeViewwith a path traversal payload in theidparameter, such as../../../conf/conf. - The publish reverse proxy forwards the request to the kernel, injecting an
X-Auth-TokenwithRoleReader. - The
CheckAuthmiddleware allows the request becauseRoleReaderis permitted. - The
removeUnusedAttributeViewhandler extracts the attacker-controlledidvalue without validation. - The application constructs a file path using
filepath.Join(util.DataDir, "storage", "av", id+".json"), resulting in a path outside the intendeddata/storage/av/directory (e.g.,<workspace>/conf/conf.json). - The application attempts to delete the file at the constructed path using
filelock.RemoveWithoutFatal(absPath). - The targeted
.jsonfile is deleted, leading to persistent destruction of Attribute View definitions, deletion of global workspace configuration, or corruption of user state.
Impact
Successful exploitation of this vulnerability allows an attacker with publish-reader access to delete arbitrary .json files under the workspace path reachable from data/storage/av/. This can lead to persistent destruction of Attribute View definitions, deletion of global workspace configuration, deletion of local storage and outline state, corruption of user state that survives reload, and forced reset/recovery flows or broken UI behavior. The impact ranges from broken UI functionality to complete data loss and application instability.
Recommendation
- Deploy the "SiYuan Path Traversal Attempt" Sigma rule to detect attempts to exploit the vulnerability via the
removeUnusedAttributeViewendpoint. - Block requests to
/api/av/removeUnusedAttributeViewcontaining path traversal sequences (e.g.,../) in theidparameter at the WAF or reverse proxy. - Apply the remediation steps outlined in the advisory, specifically implementing input validation and subpath enforcement to prevent path traversal, as referenced in the Overview.
Detection coverage 2
SiYuan Path Traversal Attempt
highDetects attempts to exploit the path traversal vulnerability in SiYuan's removeUnusedAttributeView endpoint by identifying requests with path traversal sequences in the 'id' parameter.
SiYuan Config File Deletion Attempt
criticalDetects attempts to delete the SiYuan configuration file (conf/conf.json) via the removeUnusedAttributeView endpoint path traversal vulnerability.
Detection queries are available on the platform. Get full rules →