
CVE-2025-55182 の React Server Components における RCE を、npm/pnpm/yarn のロックファイル、Docker イメージ、SBOM、およびライブ URL をスキャンして検出します。自動修正、SARIF 出力、CI/CD 統合を含みます。
CVE-2025-55182 のセキュリティスキャナー - React Server Components における重大な(CVSS 10.0)認証不要のリモートコード実行脆弱性です。
⚠️ 免責事項
これはセキュリティスキャナーであり、エクスプロイトツールではありません。開発者やセキュリティチームがプロジェクト内の脆弱な依存関係を特定するのを支援するために設計されています。
これはコミュニティ主導のオープンソースプロジェクトであり、明示的または黙示的な保証なしに「現状のまま」提供されます。著者および貢献者は、このツールの使用に起因するいかなる損害やセキュリティインシデントについても責任を負いません。
自己責任でご使用ください。 必ず手動で調査結果を確認し、所属組織のセキュリティポリシーに従ってください。問題、バグ、または提案がある場合は、貢献してプロジェクトの改善にご協力ください。
🤝 コントリビューター募集中
このプロジェクトはテスターとコントリビューターを積極的に募集しています! バグ報告、機能提案、ドキュメント改善、コード提出など、あらゆる貢献を歓迎します。貢献ガイドをご確認の上、始めてください。
このプロジェクトは、コミュニティがCVE-2025-55182に対応できるようにするために存在します。以下の方々に感謝と謝意を表します。
プロジェクトが脆弱かどうかを確認する最速の方法:```bash npx react2shell-guard .
That's it! これにより、現在のディレクトリをスキャンし、結果をすぐに表示します。
### 2. 特定のプロジェクトをスキャンする```bash
npx react2shell-guard /path/to/your/project
脆弱性が見つかりましたか?自動的に修正します:```bash
npx react2shell-guard fix --dry-run
npx react2shell-guard fix
npx react2shell-guard fix --install
### 4. ライブURLのスキャン
デプロイされたアプリケーションに脆弱性がないか確認します:```bash
npx react2shell-guard scan-url https://your-app.com
デプロイした修正が機能していることを確認します。```bash npx react2shell-guard verify-patch https://your-app.com
### 6. コンテナイメージのスキャン
Dockerイメージに脆弱なパッケージが含まれているか確認してください:```bash
npx react2shell-guard scan-image myapp:latest
脆弱性を修正するためのGitHub PRを自動的に作成します:```bash npx react2shell-guard create-pr --dry-run # Preview npx react2shell-guard create-pr # Create PR
---
## CVE-2025-55182 とは?
2025年11月29日、セキュリティ研究者の Lachlan Davidson 氏が、React Server Components における重大な脆弱性を発見し、責任を持って開示しました。この欠陥は、React Server Function エンドポイントに送信されるペイロードのデコード方法に存在し、認証されていない攻撃者がユーザーの操作なしに影響を受けるサーバー上でリモートコード実行を達成できるようにします。
CVE-2025-55182 の CVSS スコアは 10.0 (Critical) で、React Server Components (RSC) および RSC "Flight" プロトコルを使用するフレームワークに影響します。
**影響を受けるパッケージ:**
- `react-server-dom-webpack` 19.0.0, 19.1.0-19.1.1, 19.2.0
- `react-server-dom-parcel` (same versions)
- `react-server-dom-turbopack` (same versions)
- `next` 15.0.0-15.0.4, 15.1.0-15.1.8, 15.2.0-15.2.5, 15.3.0-15.3.5, 15.4.0-15.4.7, 15.5.0-15.5.6, 16.0.0-16.0.6
**詳細情報:**
- [React セキュリティアドバイザリ](https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components)
- [Wiz リサーチ](https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182)
---
## インストール (オプション)
頻繁に使用する場合は、グローバルにインストールします:```bash
npm install -g react2shell-guard
その後、npx なしで使用する:```bash
react2shell-guard .
## 使い方ガイド
### 基本的なスキャン```bash
# Scan current directory
react2shell-guard .
# Scan specific directory
react2shell-guard /path/to/project
# Scan and ignore certain paths
react2shell-guard . --ignore-path "examples/**" "test/**"
react2shell-guard .
react2shell-guard . --json
react2shell-guard . --sarif
react2shell-guard . --html report.html
### CLIオプション
| オプション | 説明 |
|--------|-------------|
| `--json` | 結果をJSONで出力 |
| `--sarif` | 結果をSARIF 2.1.0で出力 |
| `--html <file>` | スタンドアロンHTMLレポートを生成 |
| `--no-exit-on-vuln` | 脆弱性発見時にコード1で終了しない |
| `--ignore-path <patterns>` | 無視するパス(例:`examples/**`) |
| `--debug` | デバッグ出力を有効化 |
### 終了コード
| コード | 意味 |
|------|---------|
| `0` | 脆弱性が見つかりませんでした |
| `1` | 脆弱性が検出されました |
| `2+` | 致命的なエラー |
## ライブURLスキャン
ライブエンドポイントをスキャンして脆弱かどうかを検出します:```bash
# Scan a single URL
react2shell-guard scan-url https://example.com
# Batch scan from a file (one URL per line)
react2shell-guard scan-url urls.txt --list
# With options
react2shell-guard scan-url https://example.com --timeout 5000 --json
スキャナーはパッシブフィンガープリンティングを使用して、脆弱性を悪用することなく脆弱なReact Server Componentsエンドポイントを検出します。
プローブリクエスト: 最小限のペイロードでRSC Server Action呼び出しをシミュレートする、巧妙に作成されたPOSTリクエストを送信します:
multipart/form-data コンテンツタイプを使用Next-Action ヘッダーを含むレスポンス分析: 脆弱性シグネチャについてHTTPレスポンスを分析します:
^[0-9]+:E{ - RSC Flightプロトコルエラーフォーマット"digest":"...RSC - エラーレスポンス内のRSCダイジェストReactServerComponentsError - Reactエラークラス名text/x-component.*error - コンポーネントエラーコンテンツタイプ非破壊的: これは純粋に検出メカニズムであり、悪意のあるペイロードを実行したり、脆弱性を悪用したりすることはありません。プローブは、脆弱なサーバーでエラーレスポンスをトリガーするが害を及ぼさない、良性のデータを使用します。
注記: 陽性の検出は、サーバーが脆弱なバージョンを実行しており、RSC固有のエラーシグネチャを返したことを意味します。サーバーが悪用されたことを意味するものではありません。
| オプション | 説明 |
|---|---|
--list | ターゲットをURLを含むファイルとして扱う |
--threads <n> | 同時スレッド数(デフォルト: 10) |
--timeout <ms> | リクエストタイムアウト(ミリ秒)(デフォルト: 10000) |
--json | 結果をJSONとして出力 |
--skip-ssl-verify | SSL証明書の検証をスキップ |
--verbose | 脆弱でないホストも含むすべての結果を表示 |
ターゲットが脆弱性に対してパッチ適用済みかどうかを確認します:```bash
react2shell-guard verify-patch https://example.com
react2shell-guard verify-patch https://example.com --json
### How Patch Verification Works
パッチ検証は、正確な検出を確実にするために、**複数回の連続スキャン**(デフォルト: 3回)を短い遅延を挟んで実行します:
1. **Multiple Probes**: 同じパッシブフィンガープリンティングチェックを500msの遅延で3回実行します
2. **Confidence Scoring**:
- **High confidence**: 一貫した結果で2回以上の成功スキャン
- **Medium confidence**: 決定的な結果で1回の成功スキャン
- **Low confidence**: すべてのスキャンが失敗、または結果が不明確
3. **Result Classification**:
- **PATCHED**: すべての成功スキャンで脆弱性シグネチャが検出されない
- **VULNERABLE**: 1回以上のスキャンで脆弱性シグネチャが検出された
- **Inconclusive**: 結果が混在、またはすべてのスキャンが失敗
このマルチスキャンアプローチにより、一時的なネットワーク問題による誤検出を減らし、パッチステータスに対する信頼性を高めます。
### Verification Options
| Option | Description |
|--------|-------------|
| `--timeout <ms>` | リクエストタイムアウト(ミリ秒)(デフォルト: 10000) |
| `--json` | 結果をJSONで出力 |
| `--skip-ssl-verify` | SSL証明書の検証をスキップ |
## Container Image Scanning
Docker/OCIコンテナイメージをスキャンして脆弱なパッケージを検出します:```bash
# Scan a local or remote image
react2shell-guard scan-image myapp:latest
# Scan from a registry
react2shell-guard scan-image registry.example.com/myapp:v1.0
# Skip pulling (use local image only)
react2shell-guard scan-image myapp:latest --skip-pull
# With JSON output
react2shell-guard scan-image myapp:latest --json
# With SARIF output
react2shell-guard scan-image myapp:latest --sarif
| オプション | 説明 |
|---|---|
--timeout <ms> | 操作タイムアウト(ミリ秒)(デフォルト:120000) |
--skip-pull | レジストリからのイメージプルをスキップ(ローカルのみ使用) |
--json | 結果をJSONとして出力 |
--sarif | 結果をSARIF 2.1.0として出力 |
--no-exit-on-vuln | 脆弱性が見つかった場合でもコード1で終了しない |
--debug | デバッグ出力を有効にする |
必要条件:
本番環境に到達する前に脆弱なデプロイメントをブロック:```bash
react2shell-guard vercel-check
{ "scripts": { "vercel-build": "react2shell-guard vercel-check && next build" } }
{ "buildCommand": "npx react2shell-guard vercel-check && npm run build" }
### Vercel チェックオプション
| オプション | 説明 |
|--------|-------------|
| `--no-fail` | 脆弱性がある場合でもビルドを失敗させずに警告する |
| `--ignore-path <patterns>` | 無視するパス(グロブパターン) |
| `--debug` | デバッグ出力を有効にする |
## GitHub PR 自動化
脆弱性を修正するプルリクエストを自動的に作成します:```bash
# Preview what will be done
react2shell-guard create-pr --dry-run
# Create branch and PR
react2shell-guard create-pr
# Create branch but don't push/create PR
react2shell-guard create-pr --no-push
# Custom branch name
react2shell-guard create-pr --branch fix/security-update
| オプション | 説明 |
|---|---|
--branch <名前> | 修正用のブランチ名(デフォルト: fix/cve-2025-55182) |
--dry-run | 変更を加えずに何が行われるかを表示する |
--no-push | ブランチとコミットを作成するが、プッシュやPRの作成は行わない |
要件:
react2shell-guard - CVE-2025-55182 Scanner ──────────────────────────────────────────────────
Scanned 1 project(s)
✗ my-app [VULNERABLE] Path: /path/to/my-app Framework: nextjs v15.2.1 App Router: Yes (RSC enabled)
Vulnerabilities found: - react-server-dom-webpack @ 19.1.0 Upgrade to: 19.1.2 Advisory: https://react.dev/blog/2025/12/03/... - next @ 15.2.1 Upgrade to: 15.2.6 Advisory: https://react.dev/blog/2025/12/03/...
────────────────────────────────────────────────── VULNERABLE - Action required! Upgrade affected packages to patched versions immediately.
## GitHub Actions の統合
> **注意:** 検出パターンと修正を改善した新バージョンを積極的にリリースしています。安定版リリースには `@v1` を、最新バージョンには `@latest` を使用してください。
### GitHub Marketplace アクション
統合する最も簡単な方法は、公式の GitHub Action を使用することです:```yaml
name: Security Scan
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Scan for CVE-2025-55182
uses: gensecaihq/react2shell-scanner@v1
with:
path: '.'
fail-on-vuln: true
name: Security Scan
on: [push, pull_request]
jobs: scan: runs-on: ubuntu-latest permissions: security-events: write # For SARIF upload pull-requests: write # For PR comments
steps:
- uses: actions/checkout@v4
- name: Scan for CVE-2025-55182
uses: gensecaihq/react2shell-scanner@v1
with:
path: '.'
format: sarif
fail-on-vuln: true
upload-sarif: true # Upload to GitHub Security tab
add-pr-comment: true # Comment on PRs with results
ignore-paths: 'examples/**,test/fixtures/**'
### アクション入力
| 入力 | 説明 | デフォルト |
|-------|-------------|---------|
| `path` | スキャンするパス | `.` |
| `scan-type` | スキャンの種類: `repo`, `sbom`, `container` | `repo` |
| `format` | 出力形式: `text`, `json`, `sarif` | `text` |
| `fail-on-vuln` | 脆弱性が見つかった場合に失敗 | `true` |
| `upload-sarif` | SARIFをGitHub Securityにアップロード | `false` |
| `add-pr-comment` | 結果を含むPRコメントを追加 | `false` |
| `ignore-paths` | カンマ区切りの無視パス | `''` |
| `sbom-file` | SBOMファイルパス(scan-typeがsbomの場合) | `''` |
| `container-image` | Dockerイメージ(scan-typeがcontainerの場合) | `''` |
### アクション出力
| 出力 | 説明 |
|--------|-------------|
| `vulnerable` | 脆弱性が見つかったかどうか(`true`/`false`) |
| `findings-count` | 脆弱なパッケージの数 |
| `scan-result` | 完全なスキャン結果(JSON形式) |
| `sarif-file` | SARIF出力ファイルへのパス |
### コンテナイメージのスキャン```yaml
- name: Scan Docker image
uses: gensecaihq/react2shell-scanner@v1
with:
scan-type: container
container-image: myapp:latest
### 手動CLIの使用
CLIを直接使用する場合:```yaml
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Scan for vulnerabilities
run: npx react2shell-guard@latest .
react2shell-guard は以下のロックファイルを自動的に検出・解析します:
package-lock.json (v2 および v3 形式)pnpm-lock.yamlyarn.lock (Classic および Berry 形式)以下のコマンドで package.json を自動更新し、パッチ済みバージョンを使用します:```bash
react2shell-guard fix --dry-run
react2shell-guard fix
react2shell-guard fix --install
## プリコミットフック
脆弱な依存関係のコミットを防ぐために、git hooksをインストールしてください:```bash
# Auto-detect hook framework and install
react2shell-guard init-hooks
# Preview what would be installed
react2shell-guard init-hooks --dry-run
# Force specific hook type
react2shell-guard init-hooks --hook-type husky
react2shell-guard init-hooks --hook-type lefthook
react2shell-guard init-hooks --hook-type standalone
対応フックフレームワーク:
.husky/pre-commit に追記lefthook.yml を作成/更新.git/hooks/pre-commit を作成フックは package.json に脆弱性のある依存関係が含まれている場合にコミットをブロックし、react2shell-guard fix を実行して修復するよう促します。
CycloneDX SBOM ファイルをスキャンして脆弱性を検出します:```bash
react2shell-guard scan-sbom bom.json
react2shell-guard scan-sbom bom.json --json
react2shell-guard scan-sbom bom.json --sarif
## MCPサーバー(AIアシスタント連携)
AIアシスタント連携のためにModel Context Protocolサーバーを起動します:```bash
react2shell-guard mcp-server
利用可能なMCPツール:
scan_repo - リポジトリの脆弱性をスキャンscan_sbom - CycloneDX SBOMファイルをスキャン**MCP互換クライアントで設定する(設定例):```json { "mcpServers": { "react2shell-guard": { "command": "npx", "args": ["react2shell-guard", "mcp-server"] } } }
## ランタイム保護ミドルウェア
CVE-2025-55182のエクスプロイト試行をランタイムで検出・ブロックする多層防御ミドルウェア。
### Express.js```typescript
import express from 'express';
import { createExpressMiddleware } from 'react2shell-guard/middleware';
const app = express();
// Add raw body parser for RSC payloads
app.use(express.raw({ type: 'text/x-component' }));
app.use(express.json());
// Add protection middleware
app.use(createExpressMiddleware({
action: 'block', // 'block' | 'log' | 'alert'
onAlert: (result, req) => {
// Send to your alerting system (Slack, PagerDuty, etc.)
console.error('CVE-2025-55182 exploit attempt:', result);
},
skipPaths: ['/health', '/metrics'],
}));
// middleware.ts import { withReact2ShellGuard } from 'react2shell-guard/middleware';
export const middleware = withReact2ShellGuard({ action: 'block', rscEndpointsOnly: true, // Only check RSC endpoints (recommended) });
export const config = { matcher: ['/((?!_next/static|_next/image|favicon.ico).*)'], };
**検出パターン:**
- シリアライズされた関数インジェクション
- プロトタイプ汚染の試行
- 不正なモジュール参照
- サーバーアクションの改ざん
- エンコードされた悪意のあるペイロード
- RSCストリーミング形式の悪用
## APIの使用法```typescript
import { scan } from 'react2shell-guard';
const result = scan({
path: '/path/to/project',
ignorePaths: ['examples/**'],
debug: false,
});
console.log(result.vulnerable); // boolean
console.log(result.projects); // ProjectResult[]
{ "cve": "CVE-2025-55182", "vulnerable": true, "scanTime": "2025-12-04T10:30:00Z", "projects": [ { "name": "my-app", "path": "/path/to/my-app", "framework": { "type": "nextjs", "version": "15.2.1", "appRouterDetected": true }, "findings": [ { "package": "react-server-dom-webpack", "currentVersion": "19.1.0", "fixedVersion": "19.1.2", "severity": "critical", "advisoryUrl": "https://..." } ], "vulnerable": true } ], "errors": [] }
## 修復
**自動修正(推奨):**```bash
react2shell-guard fix --install
手動アップグレード - Reactパッケージ:```bash npm install [email protected] # or 19.0.1, 19.2.1
**手動アップグレード - Next.js:**```bash
npm install [email protected] # or other patched version for your release line
リリースラインごとの修正済みNext.jsバージョン:
npm install
npm run build
npm test
npm run dev
## ライセンス
MIT