Skip to content

fix: re-check embed allowlist on iframe render - #543

Open
resistanceisliberty wants to merge 2 commits into
fileverse:mainfrom
resistanceisliberty:fix/iframe-embed-allowlist-on-render
Open

fix: re-check embed allowlist on iframe render#543
resistanceisliberty wants to merge 2 commits into
fileverse:mainfrom
resistanceisliberty:fix/iframe-embed-allowlist-on-render

Conversation

@resistanceisliberty

@resistanceisliberty resistanceisliberty commented Jul 22, 2026

Copy link
Copy Markdown

Summary

I noticed the embed allowlist only runs on the insert/paste path, not when an iframe is actually rendered. With collab, a node can show up in the document without going through that UI check, so a hostile src could load for anyone who opens the doc; including view-only.

This PR re-checks the existing allowlist before mounting iframes (and on a couple of related write/export paths), restricts embeds to HTTPS, and exports a matching host CSP frame-src helper (demo Vite headers set the same policy).

Test plan

  • npx vitest run package/utils/is-allowed-embed-src.test.ts
  • YouTube / Vimeo / SoundCloud embeds still work
  • Bad src shows blocked UI and doesn't load in the network panel
  • http:// embeds are rejected

Collab and non-UI write paths can introduce iframe nodes that skip
setIframe/parseHTML allowlisting. Validate src before mounting or
exporting embeds, require HTTPS, and export a CSP frame-src helper
for host apps (demo sets the same header).
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the fileverse Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant