React Server Components / Next.js - Flight Typed-Array Deserialization RCE
Run this lab
Lab not starting or behaving wrong? Report a problem with this lab
Summary
React Server Components (the React Flight serializer in react-server-dom-webpack / -parcel / -turbopack) contain an insecure-deserialization flaw that can lead to unauthenticated remote code execution. When a response transports multiple typed arrays that are views over the same underlying ArrayBuffer and the buffer is detached between the serializer writing the length header and flushing the bytes, the client-side decoder reads a length header that no longer matches the emitted payload and over-reads into following (attacker-influenced) stream bytes. Those bytes can be parsed as forged Flight rows that reach a Server Action with attacker-chosen arguments. In Next.js this is reachable in App Router apps with Cache Components (use cache) whose cached function returns multiple typed arrays plus an attacker-controlled value. Confirmed by diffing react-server-dom-webpack 19.2.8 (vulnerable) against 19.2.9 (patched): the fix throws on a detached buffer and copies partial views before transport.
Technical detail
Impact
Unauthenticated remote code execution on the server in the rare configurations that meet the precondition (App Router + Cache Components returning multiple typed arrays sharing a buffer plus an attacker-controlled value). CVSS 4.0 base 9.5.
Exploitation & proof of concept
React Flight typed-array over-read via use cache (unauthenticated)
A single unauthenticated GET with an annotation query value drives the vulnerable use cache function to transport two large typed-array views that share one ArrayBuffer. On a vulnerable build the second view flushes 0 bytes while its length header still claims the full size, so the React Flight decoder over-reads and the server render fails ("Connection closed" / React error boundary) -> the typed-array summary never renders. A patched build copies the partial views (view.slice()) and renders the summary cleanly. The differential (summary absent on vulnerable, present on patched) is the detection signal.
GET /?annotation=dGVzdGluZ3Rlc3Q= HTTP/1.1 Host: {{Hostname}}
HTTP/1.1 200 OK Content-Type: text/html ...React error boundary (digest); the typed-array summary (block0":8192) is absent...
Nuclei detection: vt-2026-126187.nuclei.yaml
Remediation
- Upgrade Next.js to 16.4.1 (or later).
- Upgrade react-server-dom-webpack/-parcel/-turbopack to 19.0.9 / 19.1.10 / 19.2.9 / 19.3.1 or later.
- Audit `use cache` functions that return typed arrays; avoid transporting multiple views over one shared ArrayBuffer, or copy via view.slice() before returning.
Lab setup notes
- Vulnerable lab: docker compose up -d then http://localhost:3100/ (Next.js 16.4.0 + React 19.3.0)
- Detect: nuclei -t vt-2026-126187.nuclei.yaml -u http://localhost:3100/
References
- https://vulnerabletarget.com/VT-2026-126187
- https://github.com/facebook/react/security/advisories/GHSA-xqc2-xf4c-x3h3
- https://github.com/vercel/next.js/security/advisories/GHSA-673q-mjm6-r5xr
- https://github.com/vercel/next.js/commit/a4cea6aec5da89d116b8960e113189cf51745d2f
- https://github.com/briskets/CVE-2026-126187-poc
- https://nvd.nist.gov/vuln/detail/CVE-2026-126187