Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
react2shell — RCE exploit toolkit for CVE-2025-55182 and CVE-2025-66478 in React Server Components. Includes multiple exploit variants, detection scripts, a vulnerable test server, and a deep technical analysis of the Flight protocol deserialization vulnerability. | Kitploit
Tools/GitHubGitHub/freeqaz/react2shell
Dynamic Analysis (Sandboxing)Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPenetration TestingPapers & ResearchLearning & EducationPayload Development
GitHubfreeqaz/react2shell

react2shell

RCE exploit toolkit for CVE-2025-55182 and CVE-2025-66478 in React Server Components. Includes multiple exploit variants, detection scripts, a vulnerable test server, and a deep technical analysis of the Flight protocol deserialization vulnerability.

68182210 months agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
View Repository
Share

React2Shell: RCE 0-day in React Server Components

CVE-2025-55182 (React) and CVE-2025-66478 (Next.js)

This repository contains exploit code for authorized security testing and educational purposes only.

See also: Multiple researchers have published analyses of this vulnerability. Check the References section for additional perspectives, exploit techniques, and detection methods.

What is it?

On Wednesday, December 3rd, 2025, a critical Remote Code Execution vulnerability in React Server Components was publicly disclosed. The bug, dubbed "React2Shell," allows an unauthenticated attacker to execute arbitrary code on any server running vulnerable versions of React RSC or Next.js App Router by sending a single HTTP request.

Given how ubiquitous Next.js has become - it powers a significant portion of the modern web - the impact of this vulnerability is severe. Any Next.js application using the App Router (the default for new projects since Next.js 13) with RSC enabled is vulnerable. No special configuration. No specific endpoints. Just a POST request to any route.

The vulnerability lives in React's "Flight" protocol, the serialization format used to pass data between server and client in React Server Components. A missing hasOwnProperty check during deserialization allows prototype chain traversal, ultimately reaching the JavaScript Function constructor to execute attacker-controlled code.

The flaw exists in React's react-server-dom-webpack, react-server-dom-turbopack, and react-server-dom-parcel packages. Next.js, as the dominant RSC consumer, inherits the vulnerability through its App Router.

Who is impacted?

Many services are potentially vulnerable. Next.js is one of the most popular React frameworks, used by companies of all sizes - from startups to enterprises. The App Router with React Server Components has been the default architecture for new Next.js projects since version 13, meaning most modern Next.js deployments are affected.

Any application using:

  • React Server Components with vulnerable react-server-dom-* packages (19.0.0 - 19.2.0)
  • Next.js App Router versions 15.x (before 15.0.5) and 16.x (before 16.0.7)

This includes production deployments on Vercel, AWS, self-hosted infrastructure, and anywhere else Next.js App Router applications run.

Not affected:

  • Next.js Pages Router applications (no RSC)
  • Next.js 13.x and 14.x stable releases
  • Applications using only React client-side rendering
  • Edge Runtime deployments (no process.mainModule available)

Affected Versions

React Server Components

PackageVulnerablePatched
react-server-dom-webpack19.0.0, 19.1.0, 19.1.1, 19.2.019.0.1, 19.1.2, 19.2.1+
react-server-dom-turbopack19.0.0, 19.1.0, 19.1.1, 19.2.019.0.1, 19.1.2, 19.2.1+
react-server-dom-parcel19.0.0, 19.1.0, 19.1.1, 19.2.019.0.1, 19.1.2, 19.2.1+

Next.js

Version LineVulnerablePatched
15.0.x< 15.0.515.0.5+
15.1.x< 15.1.915.1.9+
15.2.x< 15.2.615.2.6+
15.3.x< 15.3.615.3.6+
15.4.x< 15.4.815.4.8+
15.5.x< 15.5.715.5.7+
16.0.x< 16.0.716.0.7+

Mitigation

Upgrade immediately. There are no workarounds.

For Next.js applications:

npm install next@latest
# or
pnpm update next

For direct React RSC usage:

npm install react-server-dom-webpack@latest

Verify your installed versions:

npm ls next react-server-dom-webpack react-server-dom-turbopack

How the exploit works

Exploit Requirements

  1. A server running vulnerable React Server Components (via Next.js App Router or direct RSC usage)
  2. Network access to send an HTTP POST request
  3. That's it. No authentication. No specific endpoint. Any route works.

The Attack

Multiple attack vectors have been discovered for this vulnerability. The most common - and the one that works without any prerequisites - uses prototype pollution via React's Flight protocol reference system.

The exploit sends a crafted multipart POST request with a Next-Action header. The payload abuses the reference system to:

  1. Traverse the prototype chain via $1:__proto__:then
  2. Construct a fake "chunk" object that mimics React's internal Chunk class
  3. Trick the deserializer into calling the JavaScript Function constructor
  4. Execute arbitrary code when the resulting function is invoked as a Promise thenable
POST / HTTP/1.1
Host: target.com
Content-Type: multipart/form-data; boundary=----Boundary
Next-Action: x

------Boundary
Content-Disposition: form-data; name="0"

{"then":"$1:__proto__:then","status":"resolved_model","value":"{...}","_response":{...}}
------Boundary
Content-Disposition: form-data; name="1"

"$@0"
------Boundary--

The code executes during deserialization, before any action ID validation occurs. This means any Next-Action header value triggers the vulnerable code path - no valid action ID is required.

Other attack vectors exist, including $F function references and direct module gadgets. These typically require a valid action ID. See Alternative Attack Vectors for details.

The Root Cause

React's Flight protocol resolves references like $1:path:to:value by splitting on colons and traversing the object:

// ReactFlightReplyServer.js - getOutlinedModel()
for (let i = 1; i < path.length; i++) {
  value = value[path[i]];  // No hasOwnProperty check!
}

The Irony: At the top of this very file, line 35:

import hasOwnProperty from 'shared/hasOwnProperty';

The guard was imported. It was available. It just wasn't used in the one loop where it mattered most.

This single missing check allows $1:__proto__:then to traverse from a chunk object, up the prototype chain, to Chunk.prototype.then - a function that processes Promise-like objects. By crafting a fake chunk with the right properties, we control what code gets executed.

Reproducing Locally

Clone the vulnerable test server:

git clone https://github.com/freeqaz/react2shell
cd react2shell/vulnerable-next-server
pnpm install
pnpm dev

In another terminal:

./detect.sh http://localhost:3443

A vulnerable server returns HTTP 500 with E{"digest" in the response body. To demonstrate RCE:

./exploit-redirect.sh http://localhost:3443 "id"

Command output appears in the response. For interactive exploration:

./shell.sh http://localhost:3443

What's in This Repo

Vulnerable Test Server

The vulnerable-next-server/ directory contains a pre-configured Next.js 16.0.6 + React 19.2.0 application for safe local testing. It runs on port 3443 by default. This is a minimal App Router setup demonstrating that default configurations are vulnerable.

Exploit Scripts

We developed multiple exploit variants to handle different scenarios:

ScriptHTTPOutputProductionNotes
exploit-redirect.sh303x-action-redirect headerYesRecommended. No prerequisites.
exploit-throw.sh500Error response bodyNoDev mode only (errors sanitized in prod).
exploit-blind.sh200Server-side onlyYesFire-and-forget. Use for OOB exfil.
exploit-urlencoded.sh303x-action-redirect headerYesDifferent WAF signature. Requires action ID.
exploit-reflect.sh200Response bodyYesStealthiest. Requires action ID.
Download Tool