
Intentionally vulnerable Next.js app for CVE-2025-55182 security research and CTF challenges
⚠️ EDUCATIONAL PURPOSE ONLY: This is an intentionally vulnerable application designed for authorized security research and CTF challenges. Do NOT use these techniques on unauthorized systems.
A deliberately vulnerable Next.js 15.1.6 application that demonstrates CVE-2025-55182 (React2Shell) - a critical Remote Code Execution vulnerability in React Server Components. Built for security researchers, penetration testers, and students to practice exploitation techniques in a safe, isolated environment.
CVE-2025-55182, also known as React2Shell, is a critical Remote Code Execution (RCE) vulnerability affecting React Server Components in Next.js.
The vulnerability stems from improper handling of serialized data in React Server Actions. Attackers can craft malicious payloads that bypass validation and execute arbitrary code on the server through:
Before you begin, ensure you have the following installed:
docker --version
docker-compose --version
git --version
# 1. Clone the repository
git clone https://github.com/Machine-farmer/PunchingBag-for-React2Shell.git
cd PunchingBag-for-React2Shell
# 2. Build and run with Docker
docker-compose up --build
# 3. Access the application
# Open your browser to: http://localhost:3000
# 1. Clone the repository
git clone https://github.com/Machine-farmer/punchingbag-cve-2025-55182.git
cd punchingbag-cve-2025-55182
# 2. Install dependencies
npm install
# 3. Run development server
npm run dev
# 4. Access at http://localhost:3000
⚠️ Warning: Manual setup without Docker is NOT recommended for security research. Always use Docker for isolation.
# Start the vulnerable application
docker-compose up
# Start in detached mode (background)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop containers
docker-compose down
# Stop and remove volumes
docker-compose down -v
# Complete cleanup (removes images)
docker-compose down -v --rmi all
Once running, navigate to:
PunchingBag contains 5 hidden flags that test different exploitation techniques:
All flags follow the format: CTF{description_here}
# Explore the application
curl http://localhost:3000
# Check available endpoints
curl http://localhost:3000/dashboard
curl http://localhost:3000/admin
Intercept form submissions and modify the payload:
// Example malicious payload
{
"name": "attacker",
"email": "[email protected]",
"message": "__proto__: { isAdmin: true }"
}
# Inject malicious headers
curl -X POST http://localhost:3000/api/data \
-H "Content-Type: application/json" \
-H "x-user-data: {\"role\":\"admin\"}" \
-d '{"exploit": true}'
Check .env.local for credentials or exploit the authentication:
# Default admin token (intentionally weak)
Username: admin
Token: super_secret_admin_key_12345
On vulnerable component use the command execution feature:
# Simulate RCE
Command: cat /flag.txt
__proto__ propertiespunchingbag-cve-2025-55182/
├── app/
│ ├── actions.js # Vulnerable Server Actions
│ ├── layout.js # Application layout
│ ├── page.js # Homepage with CTF info
│ ├── globals.css # Global styles
│ ├── admin/
│ │ └── page.js # Admin panel (Flag 3, 4)
│ ├── dashboard/
│ │ └── page.js # User dashboard (Flag 1, 2)
│ └── api/
│ ├── data/
│ │ └── route.js # API endpoint
│ └── submit/
│ └── route.js # Form submission endpoint
├── components/
│ ├── Logo.js # Application logo
│ ├── VulnerableForm.js # Exploitable form component
│ └── UserDisplay.js # User profile display
├── lib/
│ └── flags.js # Flag management
├── public/
│ └── boxing-bag.png # Application icon
├── .env.local # Environment variables (Flag 5)
├── docker-compose.yml # Docker configuration
├── Dockerfile # Container definition
├── next.config.js # Next.js configuration
├── package.json # Dependencies
└── README.md # This file
This application is INTENTIONALLY VULNERABLE and designed for:
✅ Authorized Uses:
❌ Prohibited Uses:
# Proper cleanup after use
docker-compose down -v --rmi all
Contributions are welcome! Please follow these guidelines:
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
If this project helped you learn about web security, please consider giving it a star! ⭐
Made with 🥊 for Security Research
Remember: With great power comes great responsibility. Use your skills ethically or unethically, joking😁, never use unethically.
| Flag | Challenge | Difficulty | Points |
|---|
| 🚩 Flag 1 | Basic Reconnaissance | Easy | 100 |
| 🚩 Flag 2 | Server Action Exploit | Medium | 200 |
| 🚩 Flag 3 | Admin Access Bypass | Medium | 300 |
| 🚩 Flag 4 | Remote Code Execution | Hard | 400 |
| 🚩 Flag 5 | Environment Secrets | Medium | 250 |