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_taintObjectReferenceandexperimental_taintUniqueValueare 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,-parceland-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:
| Direction | Channel | What can cross | Security question |
|---|---|---|---|
| Server to client | Props of a Client Component rendered by a Server Component | Primitives, registered symbols, arrays, Map, Set, typed arrays, ArrayBuffer, Date, plain objects, Promises, JSX, Server Function references | Is every field in this object safe for any viewer of the page? |
| Server to client | Return value of a Server Function | Same rules as serialisable props | Does the response include internal fields or other users' data? |
| Server to client | Client module code | Everything in the 'use client' subtree, including constants | Is any secret or internal logic imported into a client module? |
| Client to server | Arguments to a Server Function | Primitives, iterables, Date, FormData, plain objects, Server Functions, Promises | Is every argument validated and is the caller authorised for this resource? |
| Client to server | Closed-over values (framework dependent) | Values captured when a Server Function is defined inline | Are 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 readprocess.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
Usermodel 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 prefixedNEXT_PUBLIC_is exposed to the client by design. - Pass Server Components as children: a Server Component passed as
childrento 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):
| API | Protects | Signature | Does not protect |
|---|---|---|---|
experimental_taintObjectReference | A 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_taintUniqueValue | A 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 Function | What it prevents | Reference |
|---|---|---|
| Authenticate from the session, never from an argument | Spoofed identity | OWASP API2 Broken Authentication |
| Authorise against the specific resource (ownership or role) | IDOR and BOLA | OWASP API1 Broken Object Level Authorization |
| Validate type, shape and range of every argument with a schema | Injection, mass assignment | NIST SP 800-53 SI-10 |
| Return a minimal result, not the updated record | Property-level exposure | OWASP API3 |
| Rate limit expensive operations | Resource exhaustion and abuse | OWASP API4 Unrestricted Resource Consumption |
| Never stringify secrets into source; read them at run time | Source 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.
| CVE | Type | CVSS | Notes from the React advisories |
|---|---|---|---|
| CVE-2025-55182 | Unauthenticated remote code execution | 10.0 | Affected 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-55184 | Denial of service | 7.5 | Crafted requests can hang the process or exhaust CPU or memory |
| CVE-2025-67779 | Denial of service | 7.5 | Earlier DoS fix was incomplete |
| CVE-2026-23864 | Denial of service | 7.5 | Added 26 January 2026; further cases mitigated |
| CVE-2025-55183 | Source code exposure | 5.3 | A 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.
- 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 thereact-server-dom-*packages there). - Patch internet-facing apps first, then internal ones; treat this as a KEV remediation with a days-level deadline.
- Verify the built output, not just
package.json: confirm the deployed bundle's resolved version, as React recommends checking production bundles. - 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.
- 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,emailof other users) do not appear. - Static rules: lint for database or
process.envimports 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.
| Metric | Target |
|---|---|
Production apps on a patched react-server-dom-* version | 100% |
| Server Functions with an authorisation check and schema validation | 100% |
| Database or secret imports outside the server-only data access layer | Zero |
| Sensitive fields detected in captured RSC payloads | Zero |
| Hardcoded secrets in Server Function source | Zero |
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
reactbut not the RSC package: the vulnerable code sits inreact-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
| Framework | Reference | Relevance |
|---|---|---|
| OWASP API Security Top 10 2023 | API1, API3, API4 | Object and property-level authorisation, resource consumption in Server Functions |
| NIST SP 800-53 Rev. 5 | SI-10, SA-11, SI-2, RA-5 | Input validation, developer testing, flaw remediation, vulnerability monitoring |
| NIST CSF 2.0 | PR.PS-06, ID.RA-01 | Secure development practice, tracking KEV vulnerabilities |
| MITRE ATT&CK v20 | T1190, T1499 | Exploitation of the RSC endpoint, denial of service |
| CISA KEV | CVE-2025-55182 | Mandatory 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-onlydata access layer that is the only place reading the database andprocess.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,
allowedOriginsbehind proxies) and rate limits.
Standards and references
- React: Critical Security Vulnerability in React Server Components
- React: Denial of Service and Source Code Exposure in React Server Components
- React: 'use server' Reference
- React: 'use client' Reference
- React: experimental_taintObjectReference
- React: experimental_taintUniqueValue
- Next.js: How to Think About Data Security in Next.js
- OWASP: API Security Top 10 2023
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