Skip to content
JournalTORIS / FIELD NOTES

← Blog Learning notes

[React] React Server Components Security Vulnerabilities (CVE-2025-55184, CVE-2025-55183) and the Reac2Shell Attack Vector

Analysis of the React Server Components DoS (CVE-2025-55184) and source code exposure (CVE-2025-55183) flaws, the Reac2Shell vector that chains them, patches, mitigations, and best practices.

13 min read Read the Korean original

Joohwan Yu · Founder, Full Stack Developer

Toris · Published

Contents

🚨 New Security Vulnerabilities Disclosed in React Server Components

Q. What are CVE-2025-55184, CVE-2025-55183, and Reac2Shell? They are a denial-of-service (DoS) flaw and a source code exposure flaw in RSC, respectively. Chained together as the Reac2Shell attack, they expose your app, so you should update to the patched versions right away.

As the head of a studio that runs several products myself, I always make the same calls in the same order when a security advisory like this appears. I confirm whether our stack is in range, decide which service to touch first, and work out how to roll the fix out with no downtime. In a case like this one, where two vulnerabilities that look low in severity can be chained as Reac2Shell, it matters not to defer based on the individual scores alone. Toris runs several Next.js-based products, including MemeCatch (밈캐치), so an RSC vulnerability is directly a matter of the trust we promised users. Below is a record of the technical details of these two CVEs, along with what I decided first from an operator’s point of view.

In December 2025, the React team disclosed two new security vulnerabilities found in React Server Components. They are tied to an attack vector called Reac2Shell, which makes them important security issues that developers need to be aware of and respond to right away.

Disclosed vulnerabilities

  • CVE-2025-55184: Denial of Service (DoS) - High severity
  • CVE-2025-55183: Source Code Exposure - Medium severity

Each of these is dangerous on its own, but when combined through the Reac2Shell attack vector they can become an even more serious security threat.

🔍 What is Reac2Shell?

Reac2Shell is an attack vector that exploits security vulnerabilities in React Server Components. It combines the two vulnerabilities:

  1. Information gathering stage: Use CVE-2025-55183 (Source Code Exposure) to collect the application’s internal structure, file paths, debug information, and so on
  2. Attack execution stage: Using the collected information, use CVE-2025-55184 (DoS) to exhaust server resources or carry out a more sophisticated attack

How React Server Components work

To understand Reac2Shell, you first need to understand how React Server Components basically work:

sequenceDiagram
    participant Client
    participant Next.js Server
    participant RSC Runtime
    participant Database

    Client->>Next.js Server: HTTP Request (RSC Payload)
    Next.js Server->>RSC Runtime: Render Server Component
    RSC Runtime->>Database: Fetch Data
    Database-->>RSC Runtime: Return Data
    RSC Runtime->>RSC Runtime: Serialize Component Tree
    RSC Runtime-->>Next.js Server: Serialized Payload
    Next.js Server-->>Client: RSC Stream Response
    Client->>Client: Deserialize & Render

Key steps:

  1. Server rendering: The Server Component runs on the server and fetches data
  2. Serialization: The rendered component tree is serialized into JSON form
  3. Stream transfer: The serialized payload is sent to the client as a stream
  4. Deserialization: The client deserializes the payload and renders it

The vulnerabilities that can arise in this process are CVE-2025-55184 and CVE-2025-55183.

Advertisement

🛑 CVE-2025-55184: Denial of Service (DoS) - High

Overview

CVE-2025-55184 is a denial-of-service (DoS) vulnerability that arises during RSC serialization and deserialization. If an attacker sends a specially crafted RSC payload, the server can fall into an infinite loop or excessive recursive rendering, exhausting CPU and memory resources.

CVSS score: High (exact score pending official announcement)

Technical details

1. RSC serialization mechanism

When React Server Components serialize a component tree, they go through the following process:

// React internal serialization process (simplified)
function serializeComponent(component: ReactElement): string {
  const type = component.type;
  const props = component.props;
  const children = component.children;

  // Recursively serialize child components
  const serializedChildren = children.map((child) => serializeComponent(child));

  return JSON.stringify({
    type,
    props,
    children: serializedChildren
  });
}

2. Vulnerability scenarios

Scenario 1: Circular reference

// Vulnerable component example
function MaliciousComponent({ depth = 0, maxDepth = 1000000 }) {
  // The attacker passes a very large maxDepth value
  if (depth < maxDepth) {
    return (
      <div>
        <MaliciousComponent depth={depth + 1} maxDepth={maxDepth} />
        <MaliciousComponent depth={depth + 1} maxDepth={maxDepth} />
      </div>
    );
  }
  return <div>End</div>;
}

If the attacker sets maxDepth to a very large value (for example, 1,000,000), the server tries to render millions of components. As a result:

  • Memory exhaustion: Each component instance takes up memory
  • CPU exhaustion: CPU usage hits 100% during serialization
  • Server unresponsive: It can’t handle other requests

Scenario 2: Infinite loop component

// A component that triggers an infinite loop
function InfiniteLoopComponent({ data }) {
  // If data contains a circular reference
  const processed = processData(data); // An infinite loop can occur

  return (
    <div>
      {processed.map(item => (
        <InfiniteLoopComponent data={item.children} />
      ))}
    </div>
  );
}

3. Attack payload example

An attacker can send a malicious payload like the following:

{
  "type": "MaliciousComponent",
  "props": {
    "depth": 0,
    "maxDepth": 10000000,
    "children": [
      {
        "type": "MaliciousComponent",
        "props": {
          "depth": 1,
          "maxDepth": 10000000,
          "children": [
            /* ... repeats forever ... */
          ]
        }
      }
    ]
  }
}

Affected versions

The vulnerability was found in specific versions of the following React Server Components packages:

  • react-server-dom-webpack: 19.0.0 ~ 19.2.0 (some versions)
  • react-server-dom-turbopack: 19.0.0 ~ 19.2.0 (some versions)
  • react-server-dom-parcel: 19.0.0 ~ 19.2.0 (some versions)

Fixed versions:

  • 19.0.1 or later
  • 19.1.2 or later
  • 19.2.1 or later

Affected frameworks

  • Next.js: 15.0.0 ~ 15.5.x (some versions)
  • React Router: When using RSC features
  • Waku: All versions that support RSC
  • Other frameworks that support RSC

Attack scenario

sequenceDiagram
    participant Attacker
    participant Next.js Server
    participant RSC Runtime
    participant System Resources

    Attacker->>Next.js Server: Malicious RSC Payload<br/>(Deep Nested/Recursive)
    Next.js Server->>RSC Runtime: Deserialize Payload
    RSC Runtime->>RSC Runtime: Render Component Tree<br/>(Infinite Loop)
    loop Resource Exhaustion
        RSC Runtime->>System Resources: CPU Usage: 100%
        RSC Runtime->>System Resources: Memory Usage: Increasing
    end
    System Resources-->>Next.js Server: Server Overloaded
    Next.js Server-->>Attacker: Timeout / No Response
    Note over Next.js Server: Other requests blocked

How to detect it

If you see the following symptoms, you may be under a CVE-2025-55184 attack:

  1. Server CPU usage suddenly hits 100%
  2. Memory usage keeps increasing
  3. Requests to RSC endpoints time out
  4. “Maximum call stack size exceeded” errors in server logs
  5. Response times of other API endpoints rise sharply

Temporary mitigations (before patching)

Until you can apply the patch, you can take these steps:

  1. Apply rate limiting: Set request limits on RSC endpoints
  2. Limit payload size: Cap the maximum size of the request body
  3. Limit render depth: Cap the maximum depth of the component tree
  4. Set timeouts: Apply a timeout to RSC rendering
  5. Strengthen monitoring: Set up CPU/memory usage monitoring and alerts

📂 CVE-2025-55183: Source Code Exposure - Medium

Overview

CVE-2025-55183 is a source code exposure vulnerability that arises in React Server Components’ error handling. When an error occurs during RSC rendering, the error message and stack trace can expose the application’s internal structure, file paths, function names, variable values, and more.

CVSS score: Medium (exact score pending official announcement)

Technical details

1. RSC error handling mechanism

When an error occurs while React Server Components render a component on the server, the error information is sent to the client:

// React internal error handling (simplified)
try {
  const result = renderServerComponent(component);
  return serialize(result);
} catch (error) {
  // Serialize the error info and send it to the client
  return serializeError({
    message: error.message,
    stack: error.stack, // ⚠️ Vulnerability: stack trace exposed
    componentStack: error.componentStack
    // ... other debug info
  });
}

2. Vulnerability scenarios

Scenario 1: Stack trace exposure

// Vulnerable Server Component
async function UserProfile({ userId }) {
  // Look up user info in the database
  const user = await db.query(
    `SELECT * FROM users WHERE id = ${userId}` // This also has a SQL injection flaw, but here we focus on error handling
  );

  if (!user) {
    throw new Error(`User not found: ${userId}`); // ⚠️ The userId value is exposed
  }

  return <div>{user.name}</div>;
}

When an error occurs, information like the following can be exposed:

{
  "error": {
    "message": "User not found: 12345",
    "stack": "Error: User not found: 12345\n    at UserProfile (/app/src/components/UserProfile.tsx:15:23)\n    at renderServerComponent (/app/node_modules/react-server-dom-webpack/server.js:123:45)",
    "componentStack": "UserProfile\n  at App (/app/src/app/page.tsx:10:5)"
  }
}

Exposed information:

  • File path: /app/src/components/UserProfile.tsx
  • Function name: UserProfile
  • Line number: 15:23
  • Variable value: userId = 12345
  • Project structure: the /app/src/ directory layout

Scenario 2: Exposure of environment variables and configuration

// Vulnerable Server Component
async function DatabaseConnection() {
  try {
    const connection = await connect({
      host: process.env.DB_HOST,      // ⚠️ Environment variable values can end up in the error
      port: process.env.DB_PORT,
      database: process.env.DB_NAME,
      password: process.env.DB_PASSWORD
    });
    return <div>Connected</div>;
  } catch (error) {
    // The error message can contain sensitive information
    throw new Error(`Database connection failed: ${error.message}`);
  }
}

Scenario 3: Debug information exposure

// Debug info that should only be used in development
function DebugComponent({ data }) {
  if (process.env.NODE_ENV === 'development') {
    console.log('Debug info:', data);
  }

  // Even in production, debug info can be exposed when an error occurs
  if (!data) {
    throw new Error(`Data is missing. Debug: ${JSON.stringify(data)}`);
  }

  return <div>{data.content}</div>;
}

Affected versions

CVE-2025-55183 was found in the following versions:

  • react-server-dom-webpack: 19.0.0 ~ 19.2.0 (some versions)
  • react-server-dom-turbopack: 19.0.0 ~ 19.2.0 (some versions)
  • react-server-dom-parcel: 19.0.0 ~ 19.2.0 (some versions)

Fixed versions:

  • 19.0.1 or later
  • 19.1.2 or later
  • 19.2.1 or later

Attack scenario

sequenceDiagram
    participant Attacker
    participant Next.js Server
    participant RSC Runtime
    participant Error Handler

    Attacker->>Next.js Server: Malicious RSC Request<br/>(Invalid Input)
    Next.js Server->>RSC Runtime: Render Component
    RSC Runtime->>RSC Runtime: Error Occurs
    RSC Runtime->>Error Handler: Generate Error Response
    Error Handler->>Error Handler: Include Stack Trace<br/>& Debug Info
    Error Handler-->>Next.js Server: Error with Sensitive Info
    Next.js Server-->>Attacker: Error Response<br/>(Source Code Exposed)
    Note over Attacker: Analyze Exposed Info<br/>Plan Next Attack

Information that can be exposed

  1. File system structure

    • Project directory structure
    • File paths and names
    • Source code locations
  2. Application internals

    • Function and class names
    • Variable values and state
    • Database query structure
  3. Environment configuration

    • Environment variable names (the values are usually not exposed, but the names themselves are useful information)
    • Config file paths
    • Server structure
  4. Debug information

    • Debug messages used during development
    • Log level information
    • Test code paths

A real attack example

An attacker can collect information in the following way:

Step 1: Deliberately trigger an error

# Send a malicious request
curl -X POST https://example.com/api/rsc \
  -H "Content-Type: application/json" \
  -d '{
    "component": "UserProfile",
    "props": {
      "userId": null  // Pass a null value to trigger an error
    }
  }'

Step 2: Analyze the error response

{
  "error": {
    "message": "Cannot read property 'name' of null",
    "stack": "TypeError: Cannot read property 'name' of null\n    at UserProfile (/app/src/components/profiles/UserProfile.tsx:42:15)\n    at renderServerComponent (/app/node_modules/react-server-dom-webpack/server.js:123:45)\n    at processRequest (/app/src/app/api/rsc/route.ts:56:12)",
    "componentStack": "UserProfile\n  at App (/app/src/app/page.tsx:10:5)\n  at RootLayout (/app/src/app/layout.tsx:15:8)"
  }
}

Step 3: Use the collected information

Based on what it has collected, the attacker can:

  • Work out the file path structure: /app/src/components/profiles/
  • Discover the API endpoint: /app/src/app/api/rsc/route.ts
  • Understand the component structure: UserProfile, App, RootLayout
  • Plan a more sophisticated attack

How to detect it

If you see the following symptoms, you may be under a CVE-2025-55183 attack:

  1. Error responses that include detailed stack traces
  2. File paths and function names exposed to the client
  3. Development environment information exposed in production
  4. Request patterns that deliberately trigger errors
  5. The same error occurring repeatedly in error logs

Temporary mitigations (before patching)

  1. Filter error messages: Remove detailed error information in production
  2. Custom error handler: Implement a custom handler for RSC errors
  3. Error logging: Record error information only in logs before it would be sent to the client
  4. Validate environment variables: Verify that error messages don’t include environment variables
  5. Mask sensitive information: Remove or mask sensitive information in error messages

🎯 The Reac2Shell Attack Vector

Reac2Shell is an attack vector that combines CVE-2025-55183 (Source Code Exposure) and CVE-2025-55184 (DoS). Combining the two vulnerabilities allows a more sophisticated and effective attack than using either one alone.

Attack stages

A Reac2Shell attack proceeds in the following stages:

flowchart TD
    A[Attack starts] --> B[Stage 1: Information gathering<br/>CVE-2025-55183]
    B --> C{Trigger error}
    C --> D[Analyze error response]
    D --> E[Collect file paths]
    D --> F[Map API structure]
    D --> G[Understand component structure]
    E --> H[Stage 2: Plan the attack]
    F --> H
    G --> H
    H --> I[Craft sophisticated DoS payload<br/>CVE-2025-55184]
    I --> J[Exhaust server resources]
    J --> K[Service outage]

    style B fill:#ffcccc
    style I fill:#ffcccc
    style K fill:#ff0000,color:#fff

Stage 1: Information gathering (using CVE-2025-55183)

The attacker first uses CVE-2025-55183 to learn the application’s internal structure:

Information gathering strategy:

  1. Deliberately trigger errors: Cause errors with a variety of inputs to collect stack traces
  2. Analyze error patterns: Analyze the collected error messages to understand the application structure
  3. Map file paths: Extract file paths from stack traces to reconstruct the project structure
  4. Discover API endpoints: Collect API route and endpoint information from error messages

Example of collected information:

{
  "collected_info": {
    "project_structure": {
      "root": "/app/src",
      "components": "/app/src/components",
      "api": "/app/src/app/api",
      "pages": "/app/src/app"
    },
    "api_endpoints": [
      "/app/src/app/api/rsc/route.ts",
      "/app/src/app/api/users/route.ts"
    ],
    "component_hierarchy": {
      "UserProfile": {
        "path": "/app/src/components/profiles/UserProfile.tsx",
        "dependencies": ["db", "auth"]
      }
    },
    "error_patterns": {
      "database_errors": "Connection timeout",
      "auth_errors": "Unauthorized access"
    }
  }
}

Stage 2: Sophisticated attack execution (using CVE-2025-55184)

Based on the collected information, the attacker carries out a more sophisticated DoS attack:

Attack optimization strategy:

  1. Identify target components: Using the collected information, identify the components that consume the most resources
  2. Generate the optimal payload: With an understanding of the application structure, create the payload with the greatest effect
  3. Multi-vector attack: Attack several endpoints at once to fully exhaust server resources
  4. Sustained attack: Keep attacking to stop the server from recovering

Example of a sophisticated attack payload:

// An attack payload built from the information gathered in Stage 1
const attackPayload = {
  // Knowing that the UserProfile component performs a database query,
  // it is designed to exploit this and consume even more resources
  component: 'UserProfile',
  props: {
    userId: 'valid_id', // Use a valid ID so it looks like a normal request
    children: generateDeepNestedTree(1000000), // A very deeply nested tree
    // Attack structure optimized from the collected information
    attackVector: {
      depth: 10000000,
      branchingFactor: 2, // 2 children per node
      // Knowing that UserProfile performs a database query,
      // it is designed so that every render triggers a DB query
      triggerDatabaseQuery: true
    }
  }
};

Attack scenario: the full flow

sequenceDiagram
    participant Attacker
    participant Target Server
    participant RSC Runtime
    participant Database
    participant System Resources

    Note over Attacker: Phase 1: Information Gathering
    Attacker->>Target Server: Request 1: Invalid Input (Error Trigger)
    Target Server->>RSC Runtime: Render Component (Error)
    RSC Runtime-->>Target Server: Error with Stack Trace
    Target Server-->>Attacker: Error Response (Source Code Exposed)
    Attacker->>Attacker: Analyze Stack Trace<br/>Map Project Structure

    Attacker->>Target Server: Request 2: Different Invalid Input
    Target Server->>RSC Runtime: Render Component (Error)
    RSC Runtime-->>Target Server: Error with Stack Trace
    Target Server-->>Attacker: Error Response (More Info)
    Attacker->>Attacker: Complete Information Gathering

    Note over Attacker: Phase 2: Optimized Attack
    Attacker->>Target Server: Optimized DoS Payload<br/>(Based on Collected Info)
    Target Server->>RSC Runtime: Render Malicious Component
    RSC Runtime->>Database: Multiple Queries (Resource Intensive)
    Database-->>RSC Runtime: Query Results
    loop Resource Exhaustion
        RSC Runtime->>System Resources: CPU: 100%
        RSC Runtime->>System Resources: Memory: Increasing
        RSC Runtime->>System Resources: Database Connections: Exhausted
    end
    System Resources-->>Target Server: Server Overloaded
    Target Server-->>Attacker: Timeout / No Response

    Note over Attacker: Phase 3: Sustained Attack
    loop Continuous Attack
        Attacker->>Target Server: Additional DoS Payloads
        Target Server->>System Resources: Further Resource Exhaustion
    end

Why Reac2Shell is dangerous

The Reac2Shell attack vector is far more dangerous than a plain DoS attack:

  1. Information-driven attack: It attacks with an understanding of the application structure, so it is more effective
  2. Exploits multiple vulnerabilities: Combining two vulnerabilities does more damage than a single one
  3. Sustained attack: The collected information enables a continuous and sophisticated attack
  4. Detection evasion: Requests can be made to look normal, evading detection
  5. Extensibility: The collected information can be extended to other attack vectors

Defense strategy

To defend against a Reac2Shell attack, you need to fix both vulnerabilities:

  1. Patch CVE-2025-55183: Prevent source code exposure to block the information gathering stage
  2. Patch CVE-2025-55184: Fix the DoS vulnerability to block the attack execution stage
  3. Strengthen error handling: Prevent detailed error information from being exposed in production
  4. Monitoring: Detect patterns of deliberately triggered errors
  5. Rate limiting: Apply request limits to RSC endpoints
  6. Resource limits: Limit component render depth and resource usage

📦 Immediate Action and How to Update

These vulnerabilities need an immediate update. In production especially, apply the patch as soon as possible.

From an operator’s point of view, I decide patch priority as “degree of external exposure × impact on users.” The two vulnerabilities are High and Medium individually, but when combined, information exposure leads directly to targeted DoS, so I treat any product that receives public traffic as High on its own and upgrade it first. I roll it out by checking the build and RSC behavior on staging, moving to a zero-downtime deploy, and then confirming again that the version actually changed in production.

Updating Next.js

If you use Next.js, update to the latest patch version of the release line you are on:

# Next.js 15.0.x
npm install next@15.0.5

# Next.js 15.1.x
npm install next@15.1.9

# Next.js 15.2.x
npm install next@15.2.6

# Next.js 15.3.x
npm install next@15.3.6

# Next.js 15.4.x
npm install next@15.4.8

# Next.js 15.5.x
npm install next@15.5.7

# Next.js 16.0.x (currently recommended)
npm install next@16.0.7

With pnpm:

pnpm update next@latest

With yarn:

yarn upgrade next@latest

Updating React and React DOM

Update React and React DOM to the latest version:

npm install react@19.2.1 react-dom@19.2.1

Or, if you use pnpm:

pnpm update react@19.2.1 react-dom@19.2.1

React Server Components packages

If your project uses them directly, update these packages too:

# react-server-dom-webpack
npm install react-server-dom-webpack@latest

# react-server-dom-parcel
npm install react-server-dom-parcel@latest

# react-server-dom-turbopack
npm install react-server-dom-turbopack@latest

Other frameworks

React Router

If you use React Router’s RSC features:

npm install react@latest react-dom@latest
npm install react-server-dom-parcel@latest
npm install react-server-dom-webpack@latest
npm install @vitejs/plugin-rsc@latest

Waku

npm install react@latest react-dom@latest react-server-dom-webpack@latest waku@latest

@vitejs/plugin-rsc

npm install react@latest react-dom@latest @vitejs/plugin-rsc@latest

What to check after updating

After updating, check the following:

  1. Verify dependencies: Check versions with npm list react react-dom or pnpm list react react-dom
  2. Build test: Confirm the build succeeds with npm run build or pnpm build
  3. Functional test: Confirm RSC features work correctly
  4. Check error logs: Confirm no errors occur after the update

🛡️ Mitigations (Temporary Defense Before Patching)

I see mitigations not as a substitute for the patch but only as “time to buy until the patch.” For services I can upgrade right away, I skip the mitigation step and patch immediately, and I apply the measures below temporarily only to services that need a deploy window. If you can’t apply the patch immediately, apply these mitigations:

1. Strengthen error handling (mitigates CVE-2025-55183)

Implement a custom error handler so detailed error information isn’t exposed in production:

// app/api/rsc/route.ts or middleware
export async function POST(request: Request) {
  try {
    // RSC rendering logic
    const result = await renderRSC(component);
    return Response.json(result);
  } catch (error) {
    // Remove detailed error information in production
    if (process.env.NODE_ENV === 'production') {
      // Record the error in logs only
      console.error('RSC Error:', error);

      // Send only a generic error message to the client
      return Response.json(
        { error: 'An error occurred while processing your request' },
        { status: 500 }
      );
    }

    // Provide detailed error information in development
    return Response.json(
      { error: error.message, stack: error.stack },
      { status: 500 }
    );
  }
}

2. Apply rate limiting (mitigates CVE-2025-55184)

Apply rate limiting to RSC endpoints to mitigate DoS attacks:

// middleware.ts or API route
import { Ratelimit } from '@upstash/ratelimit';
import { Redis } from '@upstash/redis';

const ratelimit = new Ratelimit({
  redis: Redis.fromEnv(),
  limiter: Ratelimit.slidingWindow(10, '10 s') // Limit to 10 requests per 10 seconds
});

export async function POST(request: Request) {
  const ip = request.headers.get('x-forwarded-for') || 'unknown';
  const { success } = await ratelimit.limit(ip);

  if (!success) {
    return Response.json({ error: 'Too many requests' }, { status: 429 });
  }

  // RSC rendering logic
}

3. Limit payload size

Limit the maximum size of the request body to prevent oversized payload attacks:

// next.config.js
module.exports = {
  // Limit the maximum request body size (for example, 1MB)
  serverRuntimeConfig: {
    maxRequestBodySize: 1024 * 1024 // 1MB
  }
};

4. Limit render depth

Limit the maximum depth of the component tree to prevent recursive attacks:

// Depth limit during RSC rendering
const MAX_DEPTH = 100;

function renderWithDepthLimit(component, depth = 0) {
  if (depth > MAX_DEPTH) {
    throw new Error('Maximum component depth exceeded');
  }

  // Rendering logic
  return renderComponent(component, depth + 1);
}

5. Set timeouts

Set a timeout on RSC rendering to prevent infinite loops:

// Apply a timeout to RSC rendering
async function renderRSCWithTimeout(component, timeout = 5000) {
  return Promise.race([
    renderRSC(component),
    new Promise((_, reject) =>
      setTimeout(() => reject(new Error('Rendering timeout')), timeout)
    )
  ]);
}

6. Monitoring and alerts

Set up the following monitoring to detect attacks early:

  • CPU usage monitoring: Alert when CPU usage stays at 90% or above
  • Memory usage monitoring: Alert when memory usage rises sharply
  • Error frequency monitoring: Alert when the same error occurs repeatedly
  • Request pattern analysis: Detect request patterns that deliberately trigger errors

7. Resource limits (server level)

Set resource limits at the server level:

  • Node.js memory limit: Limit memory with the --max-old-space-size option
  • Process limits: Configure process restarts with PM2 or similar
  • Load balancer settings: Configure blocking of excessive traffic
# Node.js memory limit example
node --max-old-space-size=2048 server.js

Mitigation checklist

  • Apply error message filtering in production
  • Apply rate limiting to RSC endpoints
  • Set a payload size limit
  • Implement a render depth limit
  • Apply timeouts
  • Set up monitoring and alerts
  • Set server-level resource limits
  • Schedule regular security audits

🔒 Security Best Practices

To prevent these vulnerabilities and avoid similar security issues in the future, follow these best practices:

Security checklist for using RSC

1. Error handling

  • Prevent detailed error information from being exposed in production

    // ❌ Bad example
    catch (error) {
      return Response.json({ error: error.message, stack: error.stack });
    }
    
    // ✅ Good example
    catch (error) {
      if (process.env.NODE_ENV === 'production') {
        console.error('Error:', error);
        return Response.json({ error: 'An error occurred' });
      }
      return Response.json({ error: error.message });
    }
  • Don’t include sensitive information in error messages

    • Environment variable values
    • Database connection details
    • File system paths
    • User input values (especially IDs, tokens, and so on)

2. Input validation

  • Validate all user input

    // ✅ Good example
    function UserProfile({ userId }: { userId: string }) {
      // Input validation
      if (!userId || typeof userId !== 'string' || userId.length > 100) {
        throw new Error('Invalid userId');
      }
    
      // Run a safe query
      const user = await db.query('SELECT * FROM users WHERE id = ?', [userId]);
      return <div>{user.name}</div>;
    }
  • Limit payload size

  • Limit component depth

  • Validate recursive structures

3. Resource management

  • Apply rate limiting
  • Set timeouts
  • Monitor memory usage
  • Monitor CPU usage

4. Dependency management

  • Update dependencies regularly

    # Run periodically
    npm audit
    npm audit fix
  • Subscribe to security alerts

    • The official React blog
    • Next.js security advisories
    • GitHub Security Advisories

What to check in code review

During code review, be sure to check the following:

  1. Error handling: Is sensitive information kept from being exposed in production?
  2. Input validation: Is all user input properly validated?
  3. Resource limits: Could an infinite loop or excessive recursion occur?
  4. Dependency versions: Have the latest security patches been applied?
  5. Logging: Is sensitive information kept out of the logs?

Regular security audits

Carry out regular security audits like these:

1. Weekly audit

  • Scan dependencies for vulnerabilities (npm audit)
  • Review error logs
  • Check monitoring alerts

2. Monthly audit

  • Review code security
  • Check error handling logic
  • Verify rate limiting and resource limit settings

3. Quarterly audit

  • Review the overall security policy
  • Check compliance with security best practices
  • Consider an external security audit

Scanning dependencies for vulnerabilities

Scan your dependencies for vulnerabilities regularly:

# Run npm audit
npm audit

# Fix vulnerabilities that can be fixed automatically
npm audit fix

# Details of serious vulnerabilities
npm audit --audit-level=high

# Output in JSON format
npm audit --json

With pnpm:

pnpm audit
pnpm audit --fix

With yarn:

yarn audit
yarn audit --fix

Security monitoring

Set up the following monitoring:

  1. Real-time monitoring

    • CPU/memory usage
    • Error frequency
    • Request pattern analysis
  2. Alert settings

    • CPU usage at 90% or above
    • A sharp rise in memory usage
    • Repeated errors
    • Suspicious request patterns
  3. Log analysis

    • Review error logs regularly
    • Analyze access patterns
    • Detect abnormal behavior

Security training

Train your team members on the following:

  1. Security awareness: Understand how serious security vulnerabilities are
  2. Best practices: How to write secure code
  3. Incident response: Procedures for responding when a security incident occurs
  4. Regular updates: The importance of security patches

📚 References

Official security advisories

CVE details

  • CVE-2025-55184: NVD · CVE Details (to be updated after the official announcement)
  • CVE-2025-55183: NVD · CVE Details (to be updated after the official announcement)

Security tools

  • npm audit: Scan Node.js packages for vulnerabilities
  • Snyk: Open-source security scanning
  • Dependabot: Automated dependency updates on GitHub
  • Renovate: Automated dependency updates

🎯 Conclusion

The two new React Server Components vulnerabilities (CVE-2025-55184, CVE-2025-55183) and the Reac2Shell attack vector are serious security threats. Reac2Shell is especially dangerous because it combines the two vulnerabilities.

Immediate actions:

  1. ✅ Update to the latest patched version (top priority)
  2. ✅ Prevent error information exposure in production
  3. ✅ Apply rate limiting and resource limits
  4. ✅ Regular security audits and monitoring

Long-term actions:

  1. ✅ Follow security best practices
  2. ✅ Scan dependencies for vulnerabilities regularly
  3. ✅ Train team members on security
  4. ✅ Build a culture of security awareness

Security isn’t finished with a single action. Protect your application through continuous monitoring and improvement.

Toris’s security response principles

The procedure Toris follows when it sees an advisory like this is simple. Subscribe to the official security advisories; when one appears, first determine whether our stack is in range; patch in order of exposure; and after redeploying, verify again which version is actually in effect and whether the temporary mitigations have been removed. In a case like this one, where vulnerabilities can be chained, the key is to set priority by the “worst-case scenario when combined” rather than by individual severity. The mitigation and best-practice checklists above translate this procedure to the level of a single service, so you can just follow them in order.

If you need maintenance or operations that include this kind of security response, contact us through the Toris contact page.


Updated: December 12, 2025
Author: Toris
Category: React, Security

⚠️ Important: This post was written based on publicly disclosed security vulnerability information. For the latest information, check the official React security advisories.

Advertisement