Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯Š PunchingBag - CVE-2025-55182 Security Research Platform

Next.js React Docker License CVE PunchingBag Platform

⚠️ 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.


πŸ“‹ Table of Contents


πŸ” About CVE-2025-55182

CVE-2025-55182, also known as React2Shell, is a critical Remote Code Execution (RCE) vulnerability affecting React Server Components in Next.js.

Vulnerability Details

  • CVE ID: CVE-2025-55182
  • Type: Remote Code Execution (RCE)
  • CVSS Score: 10.0 (Critical)
  • Affected Versions: Next.js 15.1.6 and earlier with React Server Components enabled
  • Attack Vector: Unsafe deserialization in RSC Flight protocol
  • Impact: Complete system compromise, data exfiltration, privilege escalation

How It Works

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:

  1. Prototype pollution in JavaScript objects
  2. Unsafe deserialization of React Flight payloads
  3. Server Action parameter manipulation
  4. Header injection in Server Components

✨ Features

  • 🐳 Fully Dockerized - Complete isolation from host system
  • 🎯 5 CTF Flags - Progressive difficulty challenges
  • πŸ”“ Multiple Attack Vectors - Server Actions, API routes, authentication bypass
  • πŸ“š Educational Resources - Built-in hints and exploitation guides
  • πŸ›‘οΈ Safe Environment - No risk to production systems
  • 🎨 Realistic Application - Realistic app theme with admin panel
  • πŸ“Š Progress Tracking - Monitor your flag captures
  • πŸ”§ Vulnerable Version of React and Next.js - React 19.0.0, Next.js 15.1.6

πŸ”§ Prerequisites

Before you begin, ensure you have the following installed:

  • Docker: Version 20.10 or higher
  • Docker Compose: Version 2.0 or higher
  • Git: For cloning the repository

Check Your Installation

docker --version
docker-compose --version
git --version

πŸ“¦ Installation

Quick Start

# 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

Manual Setup (Without Docker)

# 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.


πŸš€ Usage

Starting the Environment

# Start the vulnerable application
docker-compose up

# Start in detached mode (background)
docker-compose up -d

# View logs
docker-compose logs -f

Stopping the Environment

# Stop containers
docker-compose down

# Stop and remove volumes
docker-compose down -v

# Complete cleanup (removes images)
docker-compose down -v --rmi all

Accessing the Application

Once running, navigate to:


🎯 CTF Challenges

PunchingBag contains 5 hidden flags that test different exploitation techniques:

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

Flag Format

All flags follow the format: CTF{description_here}

Hints

  • Flag 1: Explore the application structure and dashboard
  • Flag 2: Look for Server Actions that accept user input
  • Flag 3: Check environment variables for credentials
  • Flag 4: Exploit the RCE vulnerability in admin console
  • Flag 5: Extract hidden configuration data

πŸ”“ Exploitation Guide

Tools You'll Need

  • Burp Suite - HTTP request interception and modification
  • curl - Command-line HTTP client for payload crafting
  • Browser DevTools - Network traffic inspection
  • Postman - API testing (optional)

Basic Exploitation Workflow

1. Reconnaissance

# Explore the application
curl http://localhost:3000

# Check available endpoints
curl http://localhost:3000/dashboard
curl http://localhost:3000/admin

2. Server Action Exploitation

Intercept form submissions and modify the payload:

// Example malicious payload
{
  "name": "attacker",
  "email": "test@example.com",
  "message": "__proto__: { isAdmin: true }"
}

3. Header Injection

# 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}'

4. Admin Access

Check .env.local for credentials or exploit the authentication:

# Default admin token (intentionally weak)
Username: admin
Token: super_secret_admin_key_12345

5. Remote Code Execution

On vulnerable component use the command execution feature:

# Simulate RCE
Command: cat /flag.txt

Advanced Techniques

  • Prototype Pollution: Inject __proto__ properties
  • RSC Payload Crafting: Modify React Flight serialized data
  • Session Hijacking: Manipulate authentication tokens
  • API Fuzzing: Test all endpoints for vulnerabilities

πŸ“ Project Structure

punchingbag-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

πŸ›‘οΈ Security Notice

⚠️ IMPORTANT DISCLAIMERS

This application is INTENTIONALLY VULNERABLE and designed for:

βœ… Authorized Uses:

  • Security research and education
  • Penetration testing skill development
  • CTF competitions and training
  • Academic coursework in cybersecurity
  • Vulnerability assessment practice

❌ Prohibited Uses:

  • Testing on systems without explicit authorization
  • Production deployments of any kind
  • Malicious attacks on real systems
  • Distribution of exploitation tools for illegal purposes

Legal Compliance

  • Always obtain written permission before testing systems you don't own
  • Follow responsible disclosure practices for real vulnerabilities
  • Comply with local laws and regulations regarding security testing
  • Respect terms of service of all systems and platforms

Isolation Requirements

  • ALWAYS run in Docker for proper isolation
  • NEVER expose port 3000 to public internet
  • Use only in controlled lab environments
  • Stop/Destroy containers after research sessions
# Proper cleanup after use
docker-compose down -v --rmi all

🀝 Contributing

Contributions are welcome! Please follow these guidelines:

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution Ideas

  • Add new exploitation challenge
  • Improve documentation
  • Create video tutorials
  • Add new vulnerability demonstrations
  • Enhance UI/UX
  • Write automated exploitation scripts

Code of Conduct

  • Be respectful and professional
  • Focus on educational value
  • Do not add malicious code
  • Test thoroughly before submitting

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Assets

  • Boxing bag icon from Flaticon (Free license with attribution)

πŸ™ Acknowledgments

  • Next.js Team - For the framework (and patching the vulnerability)
  • React Team - For React Server Components
  • Security Researchers - Who discovered and disclosed CVE-2025-55182
  • CTF Community - For inspiration and methodology
  • OWASP - For security testing guidelines

Educational Resources


πŸ“ž Contact & Support


πŸ”„ Updates & Changelog

Version 1.0.0 (December 2025)

  • Initial release
  • 5 CTF challenges
  • Docker support
  • Complete documentation

⭐ Star History

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.

Report Bug Β· Request Feature Β· Documentation

About

Intentionally vulnerable Next.js app for CVE-2025-55182 security research and CTF challenges

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages