
React2Shell 취약점 검증 스크립트 (React2Shell, CVE-2025-55182로도 알려짐).
verify_react_vulnerability.py)이 스크립트는 프로젝트가 심각한 React2Shell 취약점 (CVE-2025-55182)의 영향을 받는지 여부를 빠르게 확인할 수 있도록 도와주는 간단한 독립형 Python 스크립트입니다.
두 단계로 검사를 수행합니다:
package.json 파일에서 알려진 취약한 버전의 React 및 Next.js를 검사합니다.package.json 찾기: 스크립트가 실행된 디렉토리에서 package.json 파일을 찾습니다.react 및 next의 정확한 버전을 찾습니다.npm install 명령을 제공합니다."use server""use client"createSafeActionClientregisterServerReferencereact-server-dom-webpackpython3 --version 명령으로 확인할 수 있습니다.pip install packaging
verify_react_vulnerability.py 스크립트를 프로젝트의 루트 디렉토리 (package.json이 있는 디렉토리)에 배치하세요.
터미널을 열고 다음 명령을 실행하세요:
python3 verify_react_vulnerability.py
취약한 라이브러리 버전이 발견되면 스크립트가 중단되고 즉시 문제를 보고합니다:
--- Step 1: Checking versions in package.json ---
❌ VULNERABLE: Found React version 19.0.1.
...
-------------------------------------------------
❌ SUMMARY: Your project is VULNERABLE based on dependency versions.
Please update the following dependencies immediately.
--- Recommended Fixes ---
npm install [email protected] [email protected]
...
-------------------------------------------------
의존성이 안전하면 스크립트가 심층 스캔을 제안합니다.
--- Step 1: Checking versions in package.json ---
✅ OK: Found React version 18.3.1. Not in a known vulnerable range.
...
-------------------------------------------------
✅ INFO: Your project's dependencies do not seem to be affected by React2Shell.
However, vulnerable features might be in use if code was copy-pasted or 'vendored'.
Do you want to perform a comprehensive deep code scan? (y/n): y
심층 스캔에서 지표가 발견되면 상세한 보고서를 제공합니다:
--- Step 2: Performing Comprehensive Deep Code Scan ---
Searching for patterns related to React Server Components...
⚠️ WARNING: Deep scan found indicators of React Server Component usage.
This does not guarantee a vulnerability, but warrants a manual review.
Ensure your framework versions are fully patched.
- Found pattern '"use server"':
Reason: Indicates a file contains React Server Actions, the primary feature associated with the vulnerability.
In files: ['src/actions/auth.ts']
- Found pattern '"use client"':
Reason: Indicates a Client Component, which may import and use Server Actions from other files.
In files: ['src/components/LoginButton.tsx', 'src/components/ThemeSwitcher.tsx']
-------------------------------------------------
심층 스캔에서 아무것도 발견되지 않으면 프로젝트가 안전할 가능성이 높다고 확인합니다:
--- Step 2: Performing Comprehensive Deep Code Scan ---
Searching for patterns related to React Server Components...
✅ OK: The comprehensive deep scan did not find any indicators of RSC usage.
-------------------------------------------------