GHSA-vrfh-rj4q-rmhr: Read-Only Open WebUI Users Can Modify Collaborative Documents via Socket.IO
Read-Only Users Can Modify Collaborative Documents via Socket.IOAffected ComponentSocket.IO collaborative document editing handler:`backend/open_webui/socket/main.py` (lines 667-721, `ydoc:document:update` handler)Affected VersionsCurrent main branch and likely all versions with collaborative note editing.DescriptionThe `ydoc:document:update` Socket.IO event handler checks whether the sender is a member of the document's Socket.IO room (line 678) but does not verify that the sender has **write** permission. Users with read-only access join the document room via `ydoc:document:join`, which only requires `read` permission (line 520). Once in the room, the user can emit `ydoc:document:update` events that modify the in-memory Yjs document state and are broadcast to all other collaborators in real time.The `document_save_handler` (line 600) correctly checks `write` permission before persisting to the database, so the attacker cannot directly save changes. However, the tampered content is visible to all collaborators, and if any user with write access saves the document, the injected content is persisted.Compare with `ydoc:document:join` (line 520) which checks permission:CVSS 3.1 Breakdown| Metric | Value | Rationale |
|--------|-------|-----------|
| Attack Vector | Network (N) | Exploited remotely via Socket.IO events |
| Attack Complexity | Low (L) | No special conditions; attacker emits a standard Socket.IO event |
| Privileges Required | Low (L) | Requires a valid user account with read access to the shared note |
| User Interaction | None (N) | Modifications appear in real time without victim action; however, persistence requires a write-access user to save |
| Scope | Unchanged (U) | Impact is within the collaborative document context |
| Confidentiality | None (N) | No data disclosure beyond what read access already provides |
| Integrity | Low (L) | In-memory document state is modified and broadcast; persistence is indirect (requires another user to save) |
| Availability | Low (L) | Collaborative editing session can be disrupted with invalid content |Attack ScenarioUser A creates a note and shares it with User B with **read** permission.User B opens the note, which triggers `ydoc:document:join` — the server checks read permission and adds User B to the document room.User B emits `ydoc:document:update` with a crafted Yjs update payload via the Socket.IO connection (bypassing any frontend read-only enforcement).The server applies the update to the Yjs document state and broadcasts it to all collaborators.User A sees the injected content appear in their editor in real time.If User A saves the document (intentionally or via autosave), the tampered content is persisted to the database — User A's save passes the write permission check since User A is the owner.ImpactRead-only users can inject, modify, or delete content in collaborative documentsModifications are broadcast in real time to all collaborators, causing confusion or disruptionIf a write-access user saves (including autosave), the tampered content is permanently persistedUndermines the read/write permission model for collaborative editingPreconditionsAttacker must have a valid user account with read access to a shared noteThe note must be open for collaborative editing (at least one other user viewing it, or the attacker can wait for a write-access user to open and save)ConsolidationThis advisory covers read-only users modifying collaborative notes over Socket.IO. Two handlers were affected, both fixed in v0.9.0:`ydoc:document:update` — checked only room membership, not write permission, so a read-only collaborator could inject in-memory document updates broadcast to other collaborators (persistence indirect). @Classic298.`document_save_handler` — checked `permission='read'` while persisting via `Notes.update_note_by_id`, so a read-only collaborator could persist note changes directly. Reported by @hacnhoOne CVE for the consolidated advisory.
CVSS v3.1: 5.4