Join our Newsletter — 33% off our NHI Course
Home› Guides› React Server Components Security Guide: Serialisation, Taint APIs…
Guide Application Security

React Server Components Security Guide: Serialisation, Taint APIs and Data Exposure

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

React Server Components move the line between server and browser into ordinary component code, so a single prop can now carry a database row, a session token or a secret straight into a public payload. The same architecture also adds a new network-facing parser: the server decodes serialised payloads sent to Server Function endpoints, and in December 2025 that decoder was the site of CVE-2025-55182, a CVSS 10.0 unauthenticated remote code execution flaw now in CISA's Known Exploited Vulnerabilities catalogue. This guide covers the RSC trust model at the React level, applicable to Next.js, React Router, Waku, Parcel and Vite RSC integrations: what crosses the boundary, how the taint APIs work and where they fail, how to treat Server Functions as endpoints, and how to patch the react-server-dom-* packages. Next.js-specific Server Action configuration is in the Next.js Server Actions and Data Access Layer Security Guide, and general React hardening is in the React and Next.js Security Guide.

Key takeaways

  • The boundary is the module graph, not the render tree. A 'use client' file and every module it imports ship to the browser; anything passed as a prop to a Client Component is serialised into the response.
  • Server Functions are public endpoints. React's own documentation states that their arguments are fully client-controlled; every function must authenticate, authorise and validate as if it were a REST route.
  • Taint APIs are a tripwire, not a control. experimental_taintObjectReference and experimental_taintUniqueValue are experimental, protect only the exact instance or value, and are defeated by a spread, a substring or an encoding.
  • The serialisation layer itself needs patching. CVE-2025-55182 (RCE), three denial of service CVEs and a source code exposure CVE all sit in react-server-dom-webpack, -parcel and -turbopack; the safe floor is now 19.0.4, 19.1.5 or 19.2.4.
  • Minimal DTOs are the real defence. A server-only data access layer that returns only the fields the UI needs removes most exposure bugs before taint or review is needed.

The RSC trust model: what actually crosses the wire

With RSC, Server Components run only on the server and send their rendered output to the client in a serialised stream (commonly called the Flight payload). Client Components are bundled and run in the browser. React's 'use client' reference makes two points that matter for security: the directive marks the module and all of its transitive imports as client code, and "all code that is a part of the Client module sub-tree is sent to and run by the client". Where a component runs is decided by where it is imported from, not where it appears on screen.

Data flows across the boundary in two directions:

DirectionChannelWhat can crossSecurity question
Server to clientProps of a Client Component rendered by a Server ComponentPrimitives, registered symbols, arrays, Map, Set, typed arrays, ArrayBuffer, Date, plain objects, Promises, JSX, Server Function referencesIs every field in this object safe for any viewer of the page?
Server to clientReturn value of a Server FunctionSame rules as serialisable propsDoes the response include internal fields or other users' data?
Server to clientClient module codeEverything in the 'use client' subtree, including constantsIs any secret or internal logic imported into a client module?
Client to serverArguments to a Server FunctionPrimitives, iterables, Date, FormData, plain objects, Server Functions, PromisesIs every argument validated and is the caller authorised for this resource?
Client to serverClosed-over values (framework dependent)Values captured when a Server Function is defined inlineAre captured values encrypted, and are they safe if decrypted?

React already blocks some unsafe values: functions that are not Server Functions, classes, instances of non-built-in classes and null-prototype objects cannot be passed as props. That is why the Next.js data security guide suggests returning class instances from authentication helpers: a whole User object passed to a Client Component throws instead of leaking. Plain objects from an ORM or SQL driver are not blocked; they serialise with every column.

Data exposure through props: the new bug class

The classic RSC exposure bug looks harmless. A Server Component loads a user record with SELECT * and renders <Profile user={userData} />, where Profile is a Client Component that only displays the name. Every field in the row, including email, phone, password hash or internal flags, is in the payload, readable in the browser's network panel by anyone who can load the page. This is the RSC form of OWASP API Security Top 10 2023 API3 Broken Object Property Level Authorization, and it is more likely than in a REST API because there is no explicit response schema between the two components.

Patterns that prevent it

  • Server-only data access layer: put all database and secret access in modules that start with import 'server-only'. Importing such a module from client code fails the build. The Next.js guidance adds that only the data access layer should read process.env.
  • Return DTOs, not records: data access functions return a minimal object built field by field, with per-field authorisation (for example, phone number only for admins or the same team).
  • Narrow Client Component prop types: a prop typed as the full User model invites callers to pass the full record. Type props as the exact fields rendered, such as { name: string }.
  • Keep secrets out of client modules: constants in a file imported by a 'use client' module are bundled. In Next.js, any environment variable prefixed NEXT_PUBLIC_ is exposed to the client by design.
  • Pass Server Components as children: a Server Component passed as children to a Client Component stays on the server, so sensitive rendering logic does not need to move into the client tree.

The taint APIs: how they work and where they fail

React provides two experimental APIs, usable only inside Server Components and only in the experimental release channel (Next.js enables them with experimental.taint: true in next.config.js):

APIProtectsSignatureDoes not protect
experimental_taintObjectReferenceA specific object instance, such as a user record(message, object)Copies: {...user}, { name: user.name, ssn: user.ssn }, or individual fields taken out of the object
experimental_taintUniqueValueA specific high-entropy string, bigint or typed array (token, key, hash)(message, lifetime, value); lifetime is an object (use process or globalThis for the app's life)Derived values: uppercased, concatenated, base64-encoded or substring forms; low-entropy values such as PINs or phone numbers

React's documentation is explicit: "Do not rely on just tainting for security." Use taint as a tripwire in the data access layer, for example tainting every row returned from the users table and tainting API keys at module load in a server-only helper, so that a future refactor that passes them to the client fails loudly in development. Do not use it as the reason a code path is considered safe. Because the APIs are experimental, check the release channel before depending on them in production builds.

Server Functions are endpoints: authorisation and input handling

A function in a 'use server' module, or a function marked inline, becomes a network endpoint. React's documentation says the arguments are "fully client-controlled" and that each Server Function must check the logged-in user may perform the action. Two consequences catch teams out:

  • Page-level checks do not cover actions: a redirect on an admin page controls what is rendered; the Server Function on that page is a separate entry point and must check the session itself.
  • Hiding a button is not access control: the function can be called with a direct POST. Next.js mitigates discovery with encrypted, non-deterministic action IDs (cached for at most 14 days) and removes unused actions at build time, but documents that these reduce risk only and do not replace checks.
Check inside every Server FunctionWhat it preventsReference
Authenticate from the session, never from an argumentSpoofed identityOWASP API2 Broken Authentication
Authorise against the specific resource (ownership or role)IDOR and BOLAOWASP API1 Broken Object Level Authorization
Validate type, shape and range of every argument with a schemaInjection, mass assignmentNIST SP 800-53 SI-10
Return a minimal result, not the updated recordProperty-level exposureOWASP API3
Rate limit expensive operationsResource exhaustion and abuseOWASP API4 Unrestricted Resource Consumption
Never stringify secrets into source; read them at run timeSource code exposure (CVE-2025-55183)React advisory, December 2025

For CSRF, Server Actions in Next.js accept only POST and compare the Origin header with Host or X-Forwarded-Host; behind reverse proxies set serverActions.allowedOrigins rather than disabling the check. Other RSC frameworks implement this differently, so confirm the equivalent before go-live. See the OWASP API Top 10 API1 Broken Object Level Authorization Guide for authorisation design.

The serialisation layer: CVE-2025-55182 and the follow-up advisories

On 3 December 2025 the React team disclosed CVE-2025-55182, rated CVSS 10.0. Per the React advisory, a crafted HTTP request to any Server Function endpoint could achieve code execution on the server through React's decoding of the payload, and apps that implement no Server Functions could still be vulnerable if they support React Server Components. CISA added it to the KEV catalogue on 5 December 2025 with known ransomware use. It is a deserialisation flaw in the framework, not in application code: the defence is patching and inventory, plus the general guidance in the Secure Deserialisation Guide.

CVETypeCVSSNotes from the React advisories
CVE-2025-55182Unauthenticated remote code execution10.0Affected 19.0, 19.1.0, 19.1.1, 19.2.0; first fixed in 19.0.1, 19.1.2, 19.2.1
CVE-2025-55184Denial of service7.5Crafted requests can hang the process or exhaust CPU or memory
CVE-2025-67779Denial of service7.5Earlier DoS fix was incomplete
CVE-2026-23864Denial of service7.5Added 26 January 2026; further cases mitigated
CVE-2025-55183Source code exposure5.3A Server Function that stringifies an argument could return its own source; only secrets hardcoded in source were at risk, not process.env values

Patch floor: the December 2025 follow-up advisory lists 19.0.4, 19.1.5 and 19.2.4 as the fixed versions of react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack, and states that some earlier fixes were incomplete. Affected frameworks and bundlers named by React include next, react-router, waku, @parcel/rsc, @vitejs/plugin-rsc and rwsdk; upgrade through the framework's own patched release where one exists, and check the framework's advisory for exact version lines rather than copying numbers between release lines. React warned not to rely on hosting provider mitigations, which were temporary.

  1. Find every RSC runtime: search lockfiles across all repositories for react-server-dom- and for the frameworks above, including monorepos where React Native apps share a workspace (React advised updating only the react-server-dom-* packages there).
  2. Patch internet-facing apps first, then internal ones; treat this as a KEV remediation with a days-level deadline.
  3. Verify the built output, not just package.json: confirm the deployed bundle's resolved version, as React recommends checking production bundles.
  4. Hunt for exploitation on apps that ran vulnerable versions while exposed: unexpected child processes from the Node.js server, new outbound connections, and changes to files in the deployment.
  5. Rotate secrets the server process could read if you find evidence of execution, and remove any secrets hardcoded in Server Function source.

Where identity fits

An RSC server is a non-human identity in its own right: it holds database credentials, API keys and session signing keys, and with CVE-2025-55182 an unauthenticated request could run code with all of them. Keep those credentials scoped to what the rendering tier needs, prefer workload identity or short-lived credentials from a secrets manager over long-lived keys in environment files, and taint them with experimental_taintUniqueValue where supported so that a refactor cannot pass them to the client. For self-hosted Next.js across several instances, treat NEXT_SERVER_ACTIONS_ENCRYPTION_KEY as a managed secret with rotation, because it protects closed-over values in transit.

Detection, testing and measurement

  • Payload review in tests: in end-to-end tests, capture the RSC payload for key pages and assert that known sensitive field names (password, token, ssn, email of other users) do not appear.
  • Static rules: lint for database or process.env imports outside the data access layer, Server Functions without a session check in the first statements, and client prop types that reference full models.
  • Runtime telemetry: log Server Function invocations with action identifier, user, outcome and latency; alert on spikes in failed authorisation and on unusually large request bodies to action endpoints, which also helps spot DoS attempts.
  • Dependency monitoring: alert on any build that resolves a react-server-dom-* version below the patch floor.
MetricTarget
Production apps on a patched react-server-dom-* version100%
Server Functions with an authorisation check and schema validation100%
Database or secret imports outside the server-only data access layerZero
Sensitive fields detected in captured RSC payloadsZero
Hardcoded secrets in Server Function sourceZero

Common failure patterns

  • Passing ORM rows to Client Components: the whole row serialises, including fields the component never renders.
  • Trusting taint as the control: a spread or a mapped field silently strips the taint, and the API is experimental.
  • Authorisation only at the page: Server Functions defined on a protected page remain callable directly.
  • Patching react but not the RSC package: the vulnerable code sits in react-server-dom-*, which a framework may pin separately; stopping at the first December fix leaves the DoS issues open.
  • Relying on the WAF or host: hosting provider rules for CVE-2025-55182 were temporary, as React stated.
  • Secrets in source: hardcoded keys were the only secrets exposed by CVE-2025-55183; run-time secrets were not.

Framework mapping

FrameworkReferenceRelevance
OWASP API Security Top 10 2023API1, API3, API4Object and property-level authorisation, resource consumption in Server Functions
NIST SP 800-53 Rev. 5SI-10, SA-11, SI-2, RA-5Input validation, developer testing, flaw remediation, vulnerability monitoring
NIST CSF 2.0PR.PS-06, ID.RA-01Secure development practice, tracking KEV vulnerabilities
MITRE ATT&CK v20T1190, T1499Exploitation of the RSC endpoint, denial of service
CISA KEVCVE-2025-55182Mandatory remediation tracking for US federal agencies, a priority signal for everyone

Practitioner checklist

  • Inventory every app using RSC and every resolved react-server-dom-* version.
  • Upgrade to 19.0.4, 19.1.5, 19.2.4 or the framework's patched release, and verify the deployed bundle.
  • Create a server-only data access layer that is the only place reading the database and process.env.
  • Return DTOs with per-field authorisation; type Client Component props as exact fields.
  • Authenticate, authorise and schema-validate inside every Server Function.
  • Add taint calls in the data access layer as a development tripwire, not a control.
  • Remove hardcoded secrets from Server Function source.
  • Capture and scan RSC payloads in end-to-end tests for sensitive fields.
  • Configure the framework's origin checks (for Next.js, allowedOrigins behind proxies) and rate limits.

Standards and references

Related NHI Mgmt Group resources: React and Next.js Security Guide · Next.js Server Actions and Data Access Layer Security Guide · OWASP API Top 10 API3 Broken Object Property Level Authorization Guide · TypeScript and JavaScript Secure Coding Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.