html-embed: close collab broadcast window (transient embed executes in concurrent editors before persist strip) #26
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in security review of PR #16 (merged in
7a03321d).Severity: medium (accepted residual risk).
The admin gate strips
htmlEmbedin the debouncedonStoreDocument(persist), but Hocuspocus broadcasts each inbound Yjs update to connected clients immediately. So a non-admin editor with Edit rights can make a transienthtmlEmbedexecute in the browsers of OTHER authenticated editors who have the same doc open in the editable editor, in the window before the persist strips it.apps/server/src/collaboration/extensions/persistence.extension.ts(~L140-180, already documented in-code as accepted).page-editor.tsxinstantiates HocuspocusProvider).Fix options: add an inbound
onChange/beforeBroadcaststrip so a non-admin's htmlEmbed never broadcasts, OR formally sign off this as an accepted risk (move the acceptance out of a code comment into a tracked decision).