Indonesia Singapore ไทย Pilipinas Việt Nam Malaysia မြန်မာ ລາວ
← Back to Blog

React Server Components Security: What RSC Risks Mean for Your Stack

Audit every RSC deserialization boundary before shipping to production — the Flight protocol's streaming power is also its attack surface.

A figure in a lab coat examining a glowing server rack with a magnifying glass while a shadowy figure reaches through a crack in the wall behind it
Illustrated by Mikael Venne

React Server Components introduce real deserialization vulnerabilities. Here's what the CVSS 10.0 React2Shell exploit means for your RSC architecture and how to defend it.

A CVSS score of 10.0 is the engineering equivalent of a fire alarm you can’t silence. The “React2Shell” vulnerability — documented in detail by Durgesh Pawar in Smashing Magazine — has exposed a structural tension baked into React Server Components: the same streaming protocol that makes RSCs fast is precisely what makes them exploitable.

For teams in Southeast Asia shipping RSC-based storefronts on Shopee or Lazada integrations, or SaaS platforms serving multilingual markets across the region, this isn’t an abstract research problem. It’s a production architecture decision you need to make now.

What the Flight Protocol Actually Does — and Why It’s the Risk Surface

React Server Components communicate with the client via the React Flight protocol — a custom serialization format that streams UI components and their data from server to client. The performance case for this is real: RSCs reduce client-side JavaScript bundle size significantly by keeping data-fetching logic on the server, which translates directly to faster Time to Interactive scores and better Core Web Vitals, particularly on the mid-range Android devices that dominate Southeast Asian mobile usage.

But Pawar’s breakdown reveals the other side of that equation. The Flight protocol includes deserialization sinks — points where serialized data is reconstructed into executable code or component trees on the server side. If an attacker can manipulate what gets deserialized at those sinks, the result can be remote code execution. The React2Shell vulnerability demonstrates this path with uncomfortable clarity: protocol manipulation leads to shell access. That’s not a theoretical exploit chain. That’s a CVSS 10.0.

The Architectural Tradeoffs Teams Are Now Navigating

The uncomfortable truth is that RSCs were adopted at speed precisely because they solve a genuine performance problem. Server-side rendering with selective hydration is one of the most effective tools for cutting Largest Contentful Paint on content-heavy pages — the kind of product listing pages and editorial hubs that drive Southeast Asian e-commerce. Teams that moved fast to ship RSC-based architectures on Next.js 13+ did so because the performance wins were measurable and the security model felt like a framework concern, not a product team concern.

That framing no longer holds. Pawar’s analysis makes clear that the deserialization boundary between server and client requires explicit validation logic that frameworks alone don’t enforce. Specifically: any RSC that accepts untrusted input — query parameters, user-generated content, API payloads from third-party sources — and feeds that input into a deserialization path is a potential sink. Teams need to audit these boundaries the same way they audit SQL inputs or authentication middleware.

The practical implication: if you’re running Next.js App Router in production, map every use server function that touches external input. Treat the Flight protocol boundary as a trust boundary. It is one.


What Defending RSC Architectures Actually Looks Like

Defense here isn’t exotic. Pawar’s recommendations converge on a few concrete controls that performance-focused teams can implement without dismantling their architecture.

Input validation at the server action layer. Every server action that receives client-originated data needs explicit schema validation before that data touches any deserialization logic. Libraries like Zod are already common in TypeScript RSC stacks — the gap is applying them consistently at action entry points, not just at form validation layers in the UI.

Restricting the deserialization surface. Not every component needs to be a Server Component. Audit which RSCs genuinely benefit from server-side execution — data fetching, database queries, sensitive business logic — and which ones were migrated opportunistically. Reducing the RSC surface area reduces the deserialization attack surface proportionally.

Content Security Policy for streamed responses. RSC streaming responses should be treated with the same CSP discipline as any server-rendered HTML. Headers matter here. If your deployment pipeline doesn’t enforce CSP headers on Flight protocol responses, that’s a configuration gap worth closing this sprint, not next quarter.

Safari Technology Preview 248, released this week, continues WebKit’s push on security-related web platform behaviors — a reminder that browser vendors are tightening the client-side environment even as server-side attack surfaces expand. Defense needs to be bidirectional.

The Performance vs. Security False Dichotomy

Here’s the argument I want to push back on: that hardening RSC architectures means accepting performance regressions. It doesn’t, if the controls are implemented correctly.

Schema validation with Zod on server actions adds microseconds, not milliseconds. Reducing the RSC surface area — replacing unnecessary Server Components with static rendering or client components where appropriate — can actually improve streaming performance by reducing the complexity of the Flight payload. A smaller, validated deserialization surface is also a leaner one.

The brands that will navigate this best are those that treat performance architecture and security architecture as the same discipline. Both are about understanding data flow, trust boundaries, and the cost of complexity. The CSS writing-mode property — recently detailed on CSS-Tricks — is a useful parallel: a single property that handles vertical text layout for Chinese, Japanese, Korean, and other scripts used across Southeast Asia, but one that introduces layout edge cases if applied without understanding how it interacts with the rest of the box model. Power and risk travel together. The answer is always the same: understand the mechanism, define the boundaries, validate the inputs.

RSCs are not going away. The performance case is too strong, particularly for teams building for mobile-first audiences on variable network conditions. But the React2Shell vulnerability should permanently change how teams think about the server-client boundary in their architecture reviews.

The question worth sitting with: how many of your current RSC server actions were written before anyone on your team had read a single line about the Flight protocol’s security model?


At grzzly, we work with digital and e-commerce teams across Southeast Asia on exactly this intersection — performance architecture that doesn’t trade speed for security hygiene. If your team is mid-migration to the Next.js App Router or auditing an existing RSC implementation, we’re happy to pressure-test the architecture with you. Let’s talk

Diesel Grizzly

Written by

Diesel Grizzly

Core Web Vitals, rendering strategies, PWAs, and the relentless pursuit of sub-second load times. Believes that performance is the most underrated conversion optimisation lever in existence.

Enjoyed this?
Let's talk.

Start a conversation