
Security scanner for CVE-2025-55182 - Critical RCE vulnerability in React Server Components. Scan npm/pnpm/yarn lockfiles, Docker images, SBOMs, and live URLs. Auto-fix, SARIF output, GitHub Actions, Vercel integration, and runtime protection middleware.
CVE-2025-55182에 대한 보안 스캐너 - React Server Components의 중요한 (CVSS 10.0) 인증되지 않은 원격 코드 실행 취약점입니다.
⚠️ 면책 조항
이것은 보안 스캐너이며, 익스플로잇 도구가 아닙니다. 개발자와 보안 팀이 프로젝트의 취약한 종속성을 식별하는 데 도움을 주기 위해 설계되었습니다.
이것은 커뮤니티 기반 오픈 소스 프로젝트이며, 명시적이든 묵시적이든 어떠한 종류의 보증 없이 "있는 그대로" 제공됩니다. 저자와 기여자는 이 도구 사용으로 인해 발생하는 손해나 보안 사고에 대해 책임을 지지 않습니다.
사용에 따른 책임은 본인에게 있습니다. 항상 결과를 수동으로 확인하고 조직의 보안 정책을 따르십시오. 문제, 버그를 발견하거나 제안 사항이 있으면 기여하기를 통해 프로젝트를 개선하는 데 도움을 주세요.
🤝 기여자 모집
이 프로젝트는 테스터와 기여자를 적극적으로 찾고 있습니다! 버그를 보고하거나, 기능을 제안하거나, 문서를 개선하거나, 코드를 제출하고 싶다면 모든 기여를 환영합니다. 시작하려면 기여 가이드를 확인하세요.
이 프로젝트는 커뮤니티가 CVE-2025-55182에 대응하는 데 도움을 주기 위해 존재합니다. 다음 분들께 감사드립니다:
프로젝트가 취약한지 확인하는 가장 빠른 방법:```bash npx react2shell-guard .
그게 다입니다! 현재 디렉토리를 스캔하고 즉시 결과를 표시합니다.
### 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. 컨테이너 이미지 스캔
도커 이미지에 취약한 패키지가 포함되어 있는지 확인하세요:```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가 React Server Function 엔드포인트로 전송된 페이로드를 디코딩하는 방식에 존재하며, 인증되지 않은 공격자가 사용자 상호작용 없이도 영향을 받는 서버에서 원격 코드 실행을 달성할 수 있도록 합니다.
CVE-2025-55182는 CVSS 10.0 (치명적) 등급으로, 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` (동일 버전)
- `react-server-dom-turbopack` (동일 버전)
- `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 Security Advisory](https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components)
- [Wiz Research](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
스캐너는 수동 지문 수집(passive fingerprinting) 을 사용하여 취약점을 악용하지 않고 취약한 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 특정 오류 시그니처를 반환했음을 의미합니다. 서버가 악용되었다는 의미는 아닙니다.
대상이 취약점에 대해 패치되었는지 확인:```bash
react2shell-guard verify-patch https://example.com
react2shell-guard verify-patch https://example.com --json
### 패치 확인 작동 방식
패치 확인은 **여러 번의 연속 스캔**(기본값: 3회)을 수행하여 정확한 탐지를 보장합니다:
1. **다중 프로브**: 동일한 수동 핑거프린팅 검사를 500ms 간격으로 3회 실행
2. **신뢰도 점수**:
- **높은 신뢰도**: 2회 이상 성공적인 스캔에서 일관된 결과
- **중간 신뢰도**: 1회 성공적인 스캔에서 확정적 결과
- **낮은 신뢰도**: 모든 스캔 실패 또는 불확실한 결과
3. **결과 분류**:
- **패치됨**: 모든 성공적인 스캔에서 취약점 시그니처 미감지
- **취약함**: 하나 이상의 스캔에서 취약점 시그니처 감지
- **불확실**: 혼합 결과 또는 모든 스캔 실패
이러한 다중 스캔 방식은 일시적인 네트워크 문제로 인한 오탐지를 줄이고 패치 상태에 대한 더 높은 신뢰도를 제공합니다.
### 확인 옵션
| 옵션 | 설명 |
|--------|-------------|
| `--timeout <ms>` | 밀리초 단위의 요청 시간 제한 (기본값: 10000) |
| `--json` | 결과를 JSON으로 출력 |
| `--skip-ssl-verify` | SSL 인증서 확인 건너뛰기 |
## 컨테이너 이미지 스캔
취약한 패키지가 있는 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
요구 사항:
취약한 배포가 프로덕션에 도달하기 전에 차단:```bash
react2shell-guard vercel-check
{ "scripts": { "vercel-build": "react2shell-guard vercel-check && next build" } }
{ "buildCommand": "npx react2shell-guard vercel-check && npm run build" }
### Vercel Check Options
| Option | Description |
|--------|-------------|
| `--no-fail` | 취약점에 대해 빌드를 실패하지 않고 경고만 표시 |
| `--ignore-path <patterns>` | 무시할 경로 (glob 패턴) |
| `--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 <name> | 수정을 위한 브랜치 이름 (기본값: 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 Action
통합하는 가장 쉬운 방법은 공식 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 훅을 설치합니다:```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
| 옵션 | 설명 |
|---|
--list | 대상을 URL이 포함된 파일로 처리 |
--threads <n> | 동시 스레드 수 (기본값: 10) |
--timeout <ms> | 요청 제한 시간(밀리초) (기본값: 10000) |
--json | 결과를 JSON으로 출력 |
--skip-ssl-verify | SSL 인증서 확인 건너뛰기 |
--verbose | 취약하지 않은 호스트를 포함한 모든 결과 표시 |
| 옵션 | 설명 |
|---|
--timeout <ms> | 작업 제한 시간(밀리초 단위) (기본값: 120000) |
--skip-pull | 레지스트리에서 이미지 가져오기 건너뛰기 (로컬만 사용) |
--json | 결과를 JSON으로 출력 |
--sarif | 결과를 SARIF 2.1.0으로 출력 |
--no-exit-on-vuln | 취약점 발견 시 코드 1로 종료하지 않음 |
--debug | 디버그 출력 활성화 |