GCWing / GCWing/OpenBitFun

[Security]: generative widget accepts postMessage updates from any window (HTML injection via forged bitfun-widget:update)

クローズ 初心者向け
#2,603 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
2.3k
フォーク
231
平均マージ
2時間 49分
マージ済み PR(30日)
589

説明

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 32f2427697ee16f253ee6119860a03255c0b3e47 (origin/main).

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start in src/web-ui/src/tools/generative-widget/GenerativeWidgetFrame.tsx around lines 862 and 921-922. Compare the incoming message handler with the existing iframe-to-parent source validation, then verify that updates from unrelated windows cannot reach setContent while valid widget updates still work. Done means forged bitfun-widget:update messages no longer control the widget HTML.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
frontend, security
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
78/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。