Summary: The generative widget iframe shell processes message events without verifying the sender. Any window that can postMessage into the host page can forge a bitfun-widget:update event, causing arbitrary attacker-controlled HTML to be written into the widget document via setContent.
Area: Web UI
Reproduction or evidence: src/web-ui/src/tools/generative-widget/GenerativeWidgetFrame.tsx:862 registers window.addEventListener('message', ...) whose handler reads event.data and, for type === 'bitfun-widget:update', calls setContent(String(data.html || ''), Boolean(data.runScripts)) with no event.source check — while the reverse (iframe→parent) direction already validates event.source against the iframe content window (:921/:922).
Environment: BitFun version/commit 32f2427 (origin/main).
Summary: The generative widget iframe shell processes
messageevents without verifying the sender. Any window that can postMessage into the host page can forge abitfun-widget:updateevent, causing arbitrary attacker-controlled HTML to be written into the widget document viasetContent.Area: Web UI
Reproduction or evidence:
src/web-ui/src/tools/generative-widget/GenerativeWidgetFrame.tsx:862registerswindow.addEventListener('message', ...)whose handler readsevent.dataand, fortype === 'bitfun-widget:update', callssetContent(String(data.html || ''), Boolean(data.runScripts))with noevent.sourcecheck — while the reverse (iframe→parent) direction already validatesevent.sourceagainst the iframe content window (:921/:922).Environment: BitFun version/commit 32f2427 (origin/main).