Summary
Daptin's Yjs WebSocket route can let a low-privileged authenticated user access file content in a database row they are not authorized to read or update. The risk arises when a room name selects a resource without the corresponding authorization checks; unauthenticated requests are rejected.
Affected context
The issue affects Daptin's generic GET /yjs/:documentName WebSocket route when a room name in the typename.referenceId.columnName form selects a database resource. The initial-content provider reads the selected file.* column, and bidirectional synchronization can expose or change its contents without CanRead or CanUpdate checks. Unauthenticated requests are rejected; standalone non-canonical room names remain shared-by-name rooms.
Exploit preconditions
- Attack surface: The generic Yjs WebSocket route.
- Required access: An authenticated session; the user may have low privileges.
- Trigger point: A room name that identifies a database resource and file column.
- Why exploitation is possible: The selected resource is read and synchronized without authorization checks for reading or updating it.
Why this happens
The route uses a client-influenced room name to select a database resource but does not authorize access to that resource before reading or synchronizing its contents. This is an object-level authorization failure, mapping most directly to CWE-639: Authorization Bypass Through User-Controlled Key. The missing or incorrect permission checks also relate to CWE-862: Missing Authorization and CWE-863: Incorrect Authorization.
Potential impact
- An authenticated user could read restricted file content.
- A user could modify content in a row they are not authorized to update.
- Unauthorized changes could affect application data that relies on the synchronized content.
General mitigation guidance
Defensive patterns include authorizing every resource selected by client-controlled identifiers before reading or synchronizing it, and checking read and update permissions separately at the relevant operation. Prefer secure-by-default access controls, minimize trust in room names and other client-supplied selectors, and run services with only the privileges needed for their function.
How teams detect issues like this
- Review WebSocket handlers and synchronization providers for resource selection based on client-controlled room names.
- Check that authorization is performed for the specific row and column before initial reads and subsequent updates.
- Use static analysis or code-review rules to flag resource access paths that lack authorization checks.
- Enforce policies requiring authorization checks at data-access boundaries, and test access decisions for users with different privileges.

