Summary
SiYuan contains an authorization flaw in publish-mode reader endpoints that apply the visibility list instead of the disabled list when filtering content. Anonymous visitors may discover and read documents or related data that publishers explicitly marked as forbidden from publication.
Affected context
The issue occurs in SiYuan publish-mode, reader-facing endpoints that expose search results, backlinks, asset content, saved criteria, recent documents, graph data, or tags. Deployments may be at risk when anonymous users can reach these endpoints and the application evaluates the document visibility list rather than the list of content disabled for publication.
Exploit preconditions
- Attack surface: Public publish-mode reader endpoints
- Required access: Anonymous network access to the affected endpoints
- Trigger point: A request for searchable, linked, graphical, tagged, recent, saved-criteria, or asset-related content
- Why exploitation is possible: Authorization filtering uses an allow-oriented visibility list instead of correctly excluding content explicitly disabled for publication
Why this happens
The underlying bug is an authorization decision error. The affected endpoints use the wrong access-control data set when determining whether content should be exposed to unauthenticated readers, causing forbidden content to pass the publication filter. This maps to CWE-863: Incorrect Authorization, where access decisions do not correctly enforce the intended permissions or restrictions.
Potential impact
- Anonymous users may read documents that were intended to remain unpublished
- Sensitive asset content or metadata could be disclosed
- Search, backlink, graph, tag, or recent-document results could reveal confidential relationships
- Organizations could experience privacy, confidentiality, or information-governance violations
General mitigation guidance
Mitigation generally focuses on making publication authorization explicit, deny-by-default, and consistent across every reader-facing endpoint.
Common defensive patterns include:
- Apply the disabled-for-publication state as an exclusion rule before returning content or metadata
- Centralize authorization decisions so search, graph, asset, backlink, tag, and history features use the same policy
- Treat anonymous requests as untrusted and require explicit authorization for every returned object
- Filter both primary records and related metadata, including links, names, identifiers, and asset references
- Add regression tests for explicitly forbidden documents and their indirect exposure paths
- Limit published content to a separately controlled data set where practical
How teams detect issues like this
Organizations can look for this issue through:
- Static analysis and review of endpoint code that references visibility, publication, or disabled-content fields
- Code review checks for inconsistent authorization logic across search, graph, asset, backlink, tag, and recent-content handlers
- Integration tests confirming that anonymous requests cannot retrieve forbidden documents or derived metadata
- Policy enforcement requiring centralized authorization helpers for publish-mode responses
- Access-log analysis for anonymous enumeration of reader endpoints and unexpected references to unpublished content
- Neutral automated security review tools that compare endpoint behavior against publication-control policies

