Summary
SiYuan contains a publish-boundary authorization bypass in WebSocket broadcast sessions that can expose real-time content events to unauthenticated readers. When a client connects to the publish surface, it may receive edits from password-protected or forbidden documents without satisfying the intended access controls.
Affected context
The issue occurs in SiYuan deployments that expose WebSocket broadcast sessions through the publishing surface and rely on document visibility or publication checks to restrict event delivery. It becomes risky when the broadcast layer forwards content events without applying the same authorization decisions used for ordinary document access.
Exploit preconditions
- Attack surface: The published WebSocket broadcast endpoint
- Required access: Network reachability to the publish surface; authentication is not required
- Trigger point: Establishment of a WebSocket session that receives real-time content events
- Why exploitation is possible: Authorization checks at the publish boundary do not consistently constrain which document events are broadcast to connected readers
Why this happens
The vulnerability is caused by an authorization enforcement gap between the WebSocket broadcast mechanism and document-level access controls. The server can publish real-time edit events to a connected reader without first confirming that the reader is permitted to view the associated document. This behavior maps to CWE-862: Missing Authorization, where a protected operation or resource is reachable without an effective permission check.
Potential impact
- Unauthorized readers may receive protected document content
- Password-protected or forbidden documents could be disclosed through real-time events
- Confidential information may be exposed before access is revoked or content is unpublished
- Organizations could face privacy, compliance, or information-governance consequences
General mitigation guidance
Mitigation generally focuses on enforcing authorization consistently across both request-response and event-driven delivery paths.
Common defensive patterns include:
- Applying document- and publication-level authorization checks before subscribing clients to broadcast streams
- Filtering every outbound event according to the recipient's effective permissions
- Treating WebSocket connections as untrusted until access checks are completed
- Using secure-by-default publication behavior that excludes protected content from anonymous channels
- Minimizing permissions and exposed network paths for publishing services
- Avoiding reliance on client-side filtering for access control
How teams detect issues like this
Organizations can assess this class of issue through:
- Static and architectural review of WebSocket subscription and broadcast handlers
- Code review checks confirming authorization before event fan-out
- Tests that compare ordinary document permissions with real-time event visibility
- Monitoring anonymous WebSocket sessions receiving events associated with restricted documents
- Policy enforcement requiring explicit authorization decisions for every server-side event channel
- Automated security review tools configured to identify missing authorization checks on publish and subscription paths

