Summary
SiYuan before v3.7.4 does not properly enforce publication permissions for encrypted notebooks, causing them to be treated as publicly accessible by default.
Anonymous users may enumerate and retrieve fully decrypted document content through the publish API without authentication or notebook key material.
Affected context
The issue occurs in SiYuan deployments that expose the publish API and contain encrypted notebooks in an unlocked state. It becomes risky when publication authorization is not explicitly required before the API returns decrypted document content to unauthenticated clients.
Exploit preconditions
- Attack surface: SiYuan publish API
- Required access: No authentication or notebook key material may be required
- Trigger point: Requests that enumerate or retrieve published documents from an unlocked encrypted notebook
- Why exploitation is possible: The publish path defaults to public access without consistently validating whether the requester is authorized to view the notebook or its decrypted contents
Why this happens
The underlying bug is a missing authorization check in the publish-access decision path. Encrypted notebook state is not treated as sufficient protection once content is unlocked, and the API can disclose decrypted data without verifying the caller's identity or publication rights.
This maps to CWE-862: Missing Authorization, where a protected resource or operation is reachable without an effective permission check.
Potential impact
- Anonymous users may enumerate notebook documents
- Confidential document content could be disclosed in fully decrypted form
- Sensitive personal, business, or operational information could be exposed
- Published content may be harvested or redistributed
- The incident could create compliance, privacy, or reputational consequences
General mitigation guidance
Mitigation generally focuses on enforcing authorization at every publish API resource and operation, rather than relying on notebook encryption state or implicit defaults.
Common defensive patterns include:
- Defaulting encrypted notebook publication to private unless explicitly authorized
- Requiring authentication and validating document- or notebook-level permissions
- Applying consistent authorization checks to enumeration, metadata, and content retrieval endpoints
- Returning only the minimum content permitted for the authenticated requester
- Separating decryption capability from publication permission
- Using least-privilege service identities and restrictive network exposure for publish services
- Adding regression tests for anonymous access to locked and unlocked encrypted content
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review checks for publish handlers that return content before authorization
- Tests that exercise anonymous, authenticated, and unauthorized requests against encrypted notebooks
- API policy checks requiring explicit authorization for document enumeration and retrieval
- Monitoring for unauthenticated requests that enumerate documents or access unusually large volumes of published content
- Review of default access-control branches, especially paths that interpret missing publication settings as public
Automated security testing and policy-as-code tools can help identify regressions in endpoint authorization behavior.

