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
Tools/GitHubGitHub/namest504/cve-2025-66478-exploit-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationPayload Development
GitHubnamest504/cve-2025-66478-exploit-poc

CVE-2025-66478-Exploit-Poc

Proof-of-concept exploit for Next.js CVE-2025-66478, demonstrating RCE via insecure deserialization and prototype pollution in Server Actions. Includes vulnerable app and Python exploit script for security research.

View Repository
3129 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

Next.js CVE-2025-66478 PoC

English | 한국어

This repository contains a Proof of Concept (PoC) for reproducing and researching the Next.js CVE-2025-66478 vulnerability. It consists of a vulnerable Next.js application and a Python exploit script to test the vulnerability.

What is CVE-2025-66478?

This is a Remote Code Execution (RCE) vulnerability occurring in the processing of Next.js Server Actions.

Key Highlights:

  • Root Cause: Insecure Deserialization within the RSC (React Server Components) Flight protocol.
  • Attack Vector: Prototype Pollution via the __proto__ property.

Vulnerability Summary

ItemDescription
CVE IDCVE-2025-66478
TypeRemote Code Execution (RCE)
Root CauseInsecure Deserialization in RSC Flight Protocol
Severity (CVSS)10.0 (Critical)
ImpactArbitrary system command execution on the server

Attack Mechanism (Technical Detail)

  1. Payload Transmission: The attacker crafts a payload using the React Flight serialization format, injecting properties like __proto__.
  2. Insecure Deserialization & Pollution: The server deserializes the payload without proper validation, leading to pollution of Object.prototype.
  3. Thenable Gadget: The pollution injects a then property into all objects. Next.js logic misidentifies these objects as Promises (Thenables).
  4. RCE Execution: When the server attempts to await this "fake Promise", the malicious JavaScript code injected into the then method is executed (e.g., child_process.execSync).
root@kitploit:~
sequenceDiagram
    participant Attacker
    participant Server as Next.js Server
    
    Attacker->>Server: POST / (JSON with "__proto__": {"then": ...})
    Note right of Server: JSON Parsing Pollutes Object.prototype
    
    Server->>Server: Application Logic encounters an Object
    
    rect rgb(200, 150, 150)
    Note right of Server: "Thenable" Check Gadget
    Server->>Server: Checks: typeof obj.then === 'function'?
    Server-->>Server: YES (due to pollution)
    end
    
    Server->>Server: Await/Execute malicious .then()
    Note right of Server: Malicious JS Code Runs (RCE)
    
    Server-->>Attacker: Response (Action Redirect / Error info)

Consequently, as the server processes this manipulated Promise, it executes JavaScript code injected by the attacker, which can lead to system command execution. The included main.py is example code that reproduces this attack scenario.

Affected Versions

This vulnerability affects Next.js applications using the App Router.

  • Affected:
    • Next.js 15.x
    • Next.js 16.x
    • Next.js 14.3.0-canary.77 and later (Canary releases)
  • Not Affected:
    • Next.js 13.x
    • Next.js 14.x Stable releases
    • Pages Router only applications
    • Edge Runtime

Fixed Versions:

  • 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7
  • 16.0.7
  • 15.6.0-canary.58 (for PPR users)

References

  • Next.js Security Advisory
  • NVD - CVE-2025-66478

File Structure

  • next.js/: Vulnerable Next.js web application example code.
  • exploit/: Exploit execution script written in Python (main.py).

Prerequisites

  • Node.js: v18 or higher recommended.
  • Python: v3.8 or higher recommended.

1. Running the Next.js Application

First, you need to run the target Next.js server.

  1. Navigate to the next.js directory:

    root@kitploit:~
    cd next.js
    
  2. Install dependencies:

    root@kitploit:~
    npm install
    # You can also use yarn or pnpm.
    
  3. Start the development server:

    root@kitploit:~
    npm run dev
    

    Verify that you can access http://localhost:3000 via your browser.

2. Running the Python Exploit

Now you can test the vulnerability using the Python script.

  1. Navigate to the exploit directory from the project root:

    root@kitploit:~
    cd exploit
    
  2. (Optional) Using a Virtual Environment is recommended:

    root@kitploit:~
    python3 -m venv venv
    source venv/bin/activate  # For Windows: venv\Scripts\activate
    
  3. Install necessary libraries: The requests module is required.

    root@kitploit:~
    pip install requests
    
  4. Run the script:

    root@kitploit:~
    python main.py
    

    By default, it targets the local address (http://localhost:3000). To test a different address, use the --url option:

    root@kitploit:~
    python main.py --url http://target-ip:3000
    

Disclaimer

This code is provided for security research and educational purposes only. Using this tool against systems or networks without prior permission is illegal, and the user is solely responsible for any issues that arise from such use.

Download Tool