html-embed: complete the kill-switch — strip embeds at serve time on all read paths (not just shares) #28
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?
Goal: make the workspace
htmlEmbedtoggle a complete, immediate kill-switch — turning it OFF must instantly neutralize every existing embed on all read paths, not just public shares.Found in security review of PR #16 (merged in
7a03321d). Severity: low (the lingering embed is admin-authored, so this is a completeness gap, not a privilege escalation).Current state
apps/server/src/core/share/share.service.ts:496(commit41f3944e). Anonymous share viewers are fully covered. ✅apps/server/src/core/page/page.controller.ts/inforeturnspageRepo.findById(...).contentas-is.shouldExecute = !editor.isEditable || htmlEmbedEnabled(apps/client/.../html-embed/html-embed-view.tsx:73).Consequence
After an admin turns the feature OFF, a page that still has a persisted (admin-authored) embed keeps executing for authenticated view-only viewers until that page is next saved (the next write strips it). So the kill-switch is not immediate for the in-workspace read-only path, contrary to the doc's "stops executing immediately" claim (which only holds in editable mode).
Scenario: admin enables feature → adds embed to page P → disables feature → P is not edited again → a member with view-only access to P opens it → embed still runs.
Fix (pick one)
page.controller /info→ striphtmlEmbedwhenworkspace.settings.htmlEmbed !== true). Makes OFF an instant, total kill-switch with no dependency on a re-save.htmlEmbedEnabled; keep unconditional execution only for anonymous/share viewers (who rely on the server strip). Cheaper but leaves the raw source in the served payload.Option 1 is the more robust "complete the kill-switch" fix.
html-embed: regular authenticated read-only path doesn't strip embeds at serve time after toggle OFF (kill-switch lag)to html-embed: complete the kill-switch — strip embeds at serve time on all read paths (not just shares)