Summary
SiYuan versions before v3.7.4 do not consistently validate the publish-password tier for the getGraph and getLocalGraph endpoints. An unauthenticated reader may call these endpoints to retrieve block-level content and the complete reference topology of password-protected documents.
Affected context
The issue occurs in SiYuan deployments where password-protected documents are published or exposed through the graph-related endpoints. Risk is higher when those endpoints are reachable by anonymous users and the application relies on the publish-password tier to restrict access to document content and reference relationships.
Exploit preconditions
- Attack surface: Network-accessible
getGraphandgetLocalGraphendpoints - Required access: No authentication or valid document password may be required
- Trigger point: A request for graph or local-graph data associated with a password-protected document
- Why exploitation is possible: The endpoints fail to enforce the required publish-password authorization before returning block content and document reference topology
Why this happens
The vulnerability results from incomplete authorization and access-control validation on graph data endpoints. The application treats a request as eligible for processing without verifying that the caller has satisfied the publish-password tier protecting the referenced document, exposing data intended to remain restricted. This behavior maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Potential impact
- Unauthorized readers may access protected block-level document content
- Attackers could reconstruct relationships among documents and blocks
- Confidential notes, metadata, or business information may be disclosed
- Exposed reference topology could support further targeted access attempts
- Organizations may experience privacy, compliance, or intellectual-property impacts
General mitigation guidance
Mitigation generally focuses on enforcing authorization consistently at every endpoint that returns protected document data.
Common defensive patterns include:
- Require successful publish-password validation before graph data is queried or serialized
- Apply centralized, deny-by-default authorization checks to both graph endpoints
- Ensure authorization covers indirect metadata and reference topology, not only document bodies
- Minimize returned fields and avoid exposing protected content to anonymous callers
- Use least-privilege service identities and restrict public exposure of administrative or content APIs
- Add regression tests for anonymous, incorrect-password, and authorized access paths
How teams detect issues like this
Organizations can assess this risk through:
- Static and semantic analysis for endpoint handlers that return document data without authorization checks
- Code review searches for graph or metadata APIs that bypass shared access-control middleware
- Tests verifying that anonymous and invalid-password requests receive no protected content or topology
- API gateway and application policies requiring authentication or authorization for sensitive document resources
- Runtime monitoring for repeated anonymous calls to graph endpoints and unusual enumeration patterns
- Automated security testing that compares responses across authorization states

