React Server Components (RSC) have fundamentally reshaped modern web development, promising faster load times, smaller client-side bundles, and seamless server-client integration. However, beneath the abstraction layer lies a complex engineering reality: RSCs do not communicate via standard HTML or JSON. Instead, they rely on a proprietary, line-delimited streaming architecture known as the Flight protocol.

Designed to efficiently reconstruct executable behavior, component trees, and asynchronous state across the wire, Flight acts as an advanced deserialization system. In December 2025, this architectural design met real-world security stress when researchers uncovered CVE-2025-55182—a CVSS 10.0 unauthenticated remote code execution (RCE) vulnerability dubbed "React2Shell."

This investigative deep dive explores the mechanics of the Flight protocol, dissects how protocol manipulation and property traversal enabled weaponization by advanced persistent threats, and provides a rigorous, ranked set of engineering defenses to protect modern React and Next.js applications.


Detailed Chronology: From Discovery to Weaponization

The vulnerability landscape surrounding React Server Components shifted dramatically in late 2025 and early 2026. Understanding the chronology of these discoveries reveals how quickly theoretical deserialization flaws can evolve into active, weaponized campaigns.

December 2025: The Drop of CVE-2025-55182 (React2Shell)

On December 3, 2025, a critical security advisory was published regarding a flaw in the React Server Components deserialization layer. Labeled CVE-2025-55182 and quickly nicknamed React2Shell, the vulnerability allowed unauthenticated attackers to achieve full remote code execution via a single crafted HTTP request directed at a Server Function endpoint. The Cybersecurity & Infrastructure Security Agency (CISA) promptly added the flaw to its Known Exploited Vulnerabilities catalog.

In-The-Wild Exploitation: EtherRAT and KSwapDoor

Within hours of public disclosure, threat intelligence firms detected active exploitation in the wild.

  • Sysdig Threat Research linked initial exploitation waves to North Korean state-sponsored actors deploying file-less implants. Dubbed EtherRAT, these attacks leveraged a novel Ethereum blockchain implant mechanism ("EtherHiding") for command-and-control (C2) communications, making infrastructure takedowns virtually impossible.
  • Concurrently, Palo Alto Networks Unit 42 documented a sophisticated backdoor named KSwapDoor. Masquerading as [kswapd1] on infected Linux systems to blend into process lists alongside legitimate kernel swap daemons, KSwapDoor utilized RC4 encryption for internal configurations and AES-256-CFB with Diffie-Hellman key exchanges over a P2P mesh network for C2 traffic.

The Aftershocks: DoS and Info Disclosure Vectors

The initial patch for React2Shell was quickly followed by a cascade of related vulnerabilities throughout late December 2025 and January 2026:

  • CVE-2025-55184 & CVE-2025-67779 (CVSS 7.5): Sequential Denial-of-Service (DoS) vulnerabilities involving infinite recursion of nested Promises within Server Function deserialization, which hung the Node.js event loop.
  • CVE-2026-23864 (CVSS 7.5): A memory exhaustion vector resulting from unbounded request body buffering and zipbomb-style decompression.
  • CVE-2025-55183 (CVSS 5.3): An information disclosure flaw where crafted requests forced Server Functions to reflect source code when stringifying arguments.
  • CVE-2026-27978 (CVSS 5.3): A critical Cross-Site Request Forgery (CSRF) bypass in Next.js affecting origin validation for sandboxed iframes.

Flight On The Wire: Anatomy of a Streaming Protocol

To understand how React2Shell and its successor vulnerabilities operated, one must look past standard web development abstractions and inspect raw network traffic. When examining a Next.js App Router page returning Content-Type: text/x-component, developers are witnessing the Flight protocol in action.

Flight is a line-delimited streaming format where each row is a self-contained instruction processed by the client-side React runtime as it arrives. Every row adheres to a strict syntax: <ROW_ID>:<ROW_TAG><PAYLOAD>n.

1:I["./src/components/ClientComponent.js",["chunks/main.js"],"default"]
2:J["$","article",null,"children":"$1"]
0:D"name":"RootLayout","env":"Server"

Protocol Row Tags

Tag Name Functional Purpose
J JSON Tree Serialized virtual DOM nodes, component props, and HTML elements.
M Module Metadata for specific Client Component modules or chunks.
I Import Instructs the client to load a module from the bundler’s chunk map.
HL Hint/Preload Directs the browser to preload resource assets (stylesheets, fonts).
D Data Server-rendered element context and environment metadata.
E Error Serialized server-side exceptions and error boundaries.

The $ Prefix System and Control Flow

The complexity of Flight increases significantly when analyzing string values beginning with the $ character. Rather than treating these as literal text, the client-side parser (parseModelString in ReactFlightClient.js) intercepts the string and routes it through type-specific resolution paths:

  • $ (Model Reference): Resolves to another chunk in the active data stream (e.g., $2).
  • $: (Property Access): Traverses deeply into a resolved chunk’s properties (e.g., $1:user:name).
  • $F (Server Reference): Represents a callable Server Action (an RPC endpoint on the server).
  • $L (Lazy Component): Defers component loading until rendered.
  • $@ (Promise/Raw Chunk): Returns the internal wrapper object rather than its resolved value.

Crucially, Flight does not merely transport static data—it dictates behavior. It instructs the client runtime on what code to load, which asynchronous promises to await, and which RPC functions to execute.


Supporting Context & Metrics: The Mechanics of Deserialization Sinks

Historically, dangerous deserialization sinks plagued languages like Java (ObjectInputStream), Python (pickle), and PHP (unserialize), where untrusted input triggers code execution during object reconstruction. JavaScript developers long assumed safety due to the benign nature of native JSON.parse().

However, when frameworks wrap custom parsing logic around data streams, these risks reemerge. Two core JavaScript features converge within the Flight protocol to create a potent deserialization sink:

  1. Prototype Pollution via `$:Property Traversal: The getOutlinedModel function walks colon-separated paths like $1:user:name using an iterative loop:

    Weaponizing And Defending The React Flight Protocol: Deserialization Sinks In RSCs — Smashing Magazine
    for (key = 1; key < reference.length; key++)
       parentObject = parentObject[reference[key]];

    Lacking strict property ownership validation (hasOwnProperty), supplying a path like $1:__proto__:constructor:constructor walks straight up the prototype chain from a plain object to the global Function constructor. In JavaScript, Function("arbitrary code")() executes immediately.

  2. Duck Typing and Thenables: The V8 engine treats any object featuring a .then property as a "Thenable." When the runtime encounters an await statement, it invokes .then without verifying internal class slots. Flight’s asynchronous chunk resolution pipeline inadvertently honors these forged structures.


Official Statements and Framework Responses

The React core team and framework maintainers responded swiftly to these architectural challenges. Fixes shipped rapidly across React 19 releases (19.0.1, 19.1.2, 19.2.1, and subsequent DoS-mitigation patches), implementing a hardened ownership check at the module load level:

var hasOwnProperty = Object.prototype.hasOwnProperty;
// Enforced via call() across all deserialization paths
hasOwnProperty.call(value, i);

While this patch successfully neutralizes the known gadget chain by blocking prototype traversal paths, industry security researchers have noted that it treats symptoms rather than fundamentally redesigning the protocol’s trust model.


Ranked Practical Defenses for Server Components

To secure applications against structural risks in server-driven

UI protocols, engineering teams must deploy defense-in-depth measures. Below are defenses ranked by their direct impact on mitigating protocol exploits.

1. Strict Input Validation on Server Actions (Highest Impact)

Because the Flight deserializer processes raw network input before application code executes, schema validation is your primary line of defense. Always validate arguments at the absolute top of every Server Action using robust validation libraries like Zod or Valibot:

"use server"
import  z  from "zod"

const UpdateProfileSchema = z.object(
  name: z.string().min(1).max(100),
  email: z.string().email(),
)

export async function updateProfile(data: unknown) 
  // Validate the raw argument before any destructuring or property access
  const parsed = UpdateProfileSchema.safeParse(data)
  if (!parsed.success) 
    return  error: "Invalid input shape" 
  
  // Proceed exclusively with parsed.data

2. Enforcing the server-only Package

Import server-only at the top of any file housing database connectors, secrets, or internal business logic. This ensures that accidental imports by Client Components fail loudly at build time rather than leaking operational data across the wire.

3. Rigorous CSRF Hardening

Never rely solely on default framework configurations. Explicitly configure session cookies with SameSite=Strict or SameSite=Lax, implement per-session CSRF tokens for high-value mutations, and never include 'null' in experimental.serverActions.allowedOrigins, as doing so reopens critical CSRF bypass vectors for sandboxed iframes.

4. Dependency Auditing and Version Verification

Verify that your project lockfiles do not reference unpatched versions of React 19 or downstream bundler packages. Ensure deployments incorporate fixes for both RCE vectors and subsequent CPU/memory exhaustion DoS patches.

5. Leveraging the Taint API and WAFs

Utilize experimental_taintObjectReference and experimental_taintUniqueValue as development-time guardrails to prevent sensitive objects from accidentally passing into the serializer. Concurrently, deploy Web Application Firewalls (WAFs) with custom rules to inspect request bodies for prototype pollution strings (__proto__, constructor:constructor) and anomalous payload sizes.


Future Outlook

React Server Components and the Flight protocol represent a permanent shift toward server-driven UI architectures. However, as the events surrounding React2Shell demonstrated, the industry can no longer rely entirely on the implicit assumption that "the server is trusted."

As server-driven UI patterns proliferate across frameworks, the software engineering ecosystem will inevitably require more resilient cryptographic primitives—including signed component trees, verifiable payload integrity checks, and stricter boundary enforcement directly on streaming wire protocols. Until then, vigilant input validation and rigorous dependency hygiene remain mandatory practices for any production React deployment.