[CVE-2026–126187] — Unauthenticated RCE in React Server Components’ Flight Protocol
A flaw in the Flight protocol's handling of typed arrays allows an attacker to smuggle a forged module reference row into a cached response, which is then deserialised and executed on the server. This chains with Next.js Cache Components to achieve unauthenticated remote code execution by invoking a legitimate Server Action with attacker-controlled arguments.
Published on medium.com
Reactjs
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
React Server Components (RSC) do not render a screen and send it in one piece. They stream the result as a sequence of rows over a wire protocol called Flight. That stream carries far more than JSON: Promises, module references, Server Function references, Blobs and typed arrays, all as live JavaScript concepts. That expressiveness is the point of the design, and it is also where this bug lives.
CVE-2026-126187 is a vulnerability in Flight's framing. Attacker-controlled bytes can break the protocol's own row boundaries and smuggle in an arbitrary module reference disguised as data. Combined with Next.js 16's Cache Components feature (use cache), the chain ends in unauthenticated remote code execution on the server.
React's own advisory describes the trigger condition as "extremely rare cases, responses that transport multiple typed arrays and an attacker-controlled value". In practice, Node.js's default 8 KiB buffer pool makes the condition more common than that wording suggests.

Setup
The public proof of concept is briskets/CVE-2026-126187-poc, a dependency-free Python 3.8+ script. It reproduces the full chain against a lab running Next.js 16.4.0, React 19.3.0 and Node 22.
The vulnerable feature is Next.js 16's Cache Components. A function marked "use cache" has its return value serialised through the Flight format, stored in a cache entry, and later deserialised back inside the Node.js server process on subsequent requests. The server is parsing something it wrote itself, except part of that data came from the requester.
Finding it
How Flight rows are framed
Rows come in a few flavours:
1:I["victim-module",[],"*"]2:o4,ABCD0:{"msg":"hello","mod":"$1","ta":"$2"}
- Text rows (
0:{...}) are newline-terminated JSON. Sigil-prefixed strings such as$1or$2point at other rows, here ids 1 and 2. - Module reference rows (
1:I[...]) tell the client to resolve an actual module through the bundler. In a webpack build this ends in__webpack_require__(id), and that module runs. - Binary rows (
2:o4,ABCD) carryoas the type tag (Uint8Array),4as the hex-encoded byte length, andABCDas the payload. The parser consumes exactly that many bytes as data. There is no delimiter like a newline: the declared length is the boundary.
The critical asymmetry is that module reference rows get executed while binary rows get consumed. If the boundary between the two ever slips, bytes that were supposed to be inert data can masquerade as an executable row instead.
The detach problem
The mechanism sits at the intersection of ArrayBuffer detach semantics and the Web Streams API. A single ArrayBuffer can back multiple typed-array views, but a byte stream transfers, and thereby detaches, the entire ArrayBuffer of every chunk it receives. The patch commit's own comment spells this rule out explicitly.
The vulnerable serialisation code looked roughly like this:
function typedArrayToBinaryChunk(content) { return new Uint8Array(content.buffer, content.byteOffset, content.byteLength); }
Any typed array larger than 2048 bytes (VIEW_SIZE) gets wrapped in a view over the original buffer, with no copy, and written straight to the destination. The trouble starts when two large views share one buffer:
Example: an 8192-byte ArrayBuffer shared by two 4096-byte viewsview A (offset 0–4095) → write(A) → entire buffer is detachedview B (offset 4096–8191) → B.byteLength is now 0 (buffer is empty)
Instrumenting the write path during serialisation confirms it:
19.2.8 (vulnerable): write: byteLength=4096 bufferByteLength=8192 ← live shared buffer19.2.9 (fixed): write: byteLength=4096 bufferByteLength=4096 ← exact-size copy
By the time view B is processed, the serializer has already written its framing header. It promised "4096 bytes follow", and then, because the buffer was detached, it delivers a 0-byte payload. Inside writeChunk, a silent guard made this worse:
// vulnerable writeChunk skip logicif (chunk.byteLength === 0) return; // silently skipped — no error, no log
The header promises 4096 bytes. The body delivers zero. That mismatch gets silently baked into the stream.
A Node.js-specific wrinkle widens the exposure. Node serves any Buffer allocation smaller than Buffer.poolSize >>> 1 (half of the default 8 KiB) from an internal slab shared across multiple unrelated Buffers. Even without an application explicitly writing new Uint8Array(sharedBuffer, ...), an ordinary small Buffer allocation is already structurally a view over a shared buffer. React's advisory calls this "extremely rare", but the actual exposure surface is likely broader than that phrasing implies.
Why the parser trusts the wrong bytes
The Flight client parser is a small state machine: read the row id up to a colon, read a tag byte, then either scan to a newline or consume an exact byte count. The fatal detail is that the parser only trusts the length declared in the header. Whatever follows the colon, it will blindly consume that many bytes as data.
A crafted stream has this shape:
2:o1000,<4096 bytes arrive>3:o1000, ← STARVED: 4096 promised, 0 delivered4:{"more":"rows continue"}\n ← entirely swallowed as row 3's payload5:o2000,<8192 bytes of attacker content> ^ parser resynchronizes inside this payload
Three details make the chain work.
- The starved row itself does not block the tree; the swallowed row does. Row 3 resolves as a Uint8Array over the swallowed bytes: wrong, but valid. Row 4, whose header was itself eaten, never resolves, and anything referencing it just hangs. That is the opening.
- Padding is part of the exploit. Filler bytes such as
0x43(the characterC) also happen to be valid hex digits for a row id. If the padding lands wrong, it glues itself onto the next row id and corrupts parsing from the root. The attacker therefore ends the crafted blob with a tiny, valid row such as5:0\n, making the parser resynchronize at exactly the next legitimate byte. - Module chunks initialise lazily. A module reference row only executes once something consumes that chunk, so the planted row has to be reachable from something the application actually reads. Root references are the natural vehicle. Row ids are assigned sequentially within a single render, which made them predictable in testing; cross-request predictability was not verified.
Exploitation

Step 1: harvest a target Server Action
Next.js compiles each Server Action to a hex ID that ships straight into the public client bundle, because the browser needs it to reference the action. The ID ships in the public client bundle, because the browser needs it to reference the action.
Step 2: solve the byte-alignment problem
Where the forged rows need to land depends on how many bytes get swallowed (the over-read size), but that calculation is circular. For the lab's layout (chunk id 4, an 8192-byte over-read, an 8-byte header), the forged rows land exactly at offset 8184.
Step 3: plant a thenable that triggers execution
The payload planted at that exact offset is three Flight rows:
6:["id; uname -a"]5:{"id":"<discovered_action_hex_id>","bound":"$@6"}4:{"then":"$h5"}
- Row 6 is the argument array the attacker wants to pass.
- Row 5 is Server Reference metadata:
idis a genuine, registered Server Action ID, andboundpre-binds the arguments from row 6. - Row 4 overwrites the attacker-influenced cached chunk with an object carrying a
thenproperty. The$htag points at the server reference.
The trigger is JavaScript's own specification. Under ECMA-262's PromiseResolveThenableJob, any object with a callable then property is treated as a thenable, and awaiting or resolving it auto-invokes then(resolve, reject). The moment the runtime unwraps the cached value, the bound Server Action, arguments and all, gets called automatically.
This chain never walks a prototype chain and never touches the Function constructor. It simply uses the protocol's own reference-resolution machinery, correctly, to call a legitimately registered server function. That is exactly why hardening property lookups alone would not have stopped it.
Two details make this worse in the real world:
- The entire attack rides a plain
GET /?annotation=<base64>request. No POST body, noNext-Actionheader. Any WAF rule or middleware that only inspects POST traffic for Server Action calls never sees this. - The blast radius is whatever the targeted Server Action does with its arguments. The lab demo pipes the argument into
/bin/sh, but a real application's action might write to a database, touch the filesystem, or call an internal service.
Root cause
The bug starts with ArrayBuffer detach semantics: a length header is written for a body that is then dropped. typedArrayToBinaryChunk wraps large typed arrays in a view over the original buffer without copying. When two such views share one buffer, writing the first detaches the buffer, so the second view has byteLength 0. The framing header for the second view has already been written, promising its original length, and the silent if (chunk.byteLength === 0) return; in writeChunk drops the body without any error or log. The parser on the read side trusts the declared length, so it consumes the following rows as binary payload and resynchronises wherever the attacker's padding puts it.
Hardening property lookups alone would not have stopped it, because the exploit uses the protocol's own reference-resolution machinery rather than prototype pollution or dynamic code construction. The thenable pivot is standard ECMA-262 behaviour, and the Server Action ID is a legitimate, registered one.
Impact
Under the trigger conditions, an unauthenticated attacker can cause the server to invoke a Server Action of their choosing with arguments of their choosing; the lab demo pipes the argument into /bin/sh. The conditions are: the App Router with Cache Components, a use cache function returning multiple typed arrays, and a page that can resolve a Server Action. The blast radius is bounded by what the targeted action does with its arguments.
Fix
The fix shipped as PRs #37842 to #37846 ("[Flight] Improve transport protocol"). Rather than patching a single offset calculation, it adds defences at multiple independent layers.
Serialisation (write) side
function typedArrayToBinaryChunk(content) { if (content.byteLength > VIEW_SIZE && !spansEntireBuffer(content)) { return content.slice(); } }
And the silent skip is gone:
if (chunk.byteLength === 0 && isDetached(chunk.buffer)) { throw new Error( "Cannot transport a detached buffer. This usually happens when " + "trying to transport multiple buffer-spanning views on the same " + "underlying buffer. Either reuse the exact same view by identity " + "or copy the underlying buffer manually via view.slice()." ); }
Deserialisation (read) side
ReactFlightClient.jsintroduces a module-privateRESPONSE_SYMBOL, moving the parser's internal state behind a symbol that is unreachable through ordinary property access.- A new
ReactFlightReplyBackingFormData.jsreplaces raw FormData lookups with an indexed backing store that separates key spaces by kind: entries prefixed_are referenced FormData entries,Smarks stream/async-iterable chunks, everything else is a one-shot chunk. A chunk's kind is now determined by where it is stored, not by a key name the attacker chose. createModelnow returnsnullwhenever athenproperty holds a function, shutting down the thenable pivot at parse time even if a forged row manages to land again.loadServerReferencerejects anymetaData.idthat is not a string before it ever reachesresolveServerReferenceorrequireModule.
The fastest way to confirm a build is patched is to grep the compiled bundle for a new helper:
grep -c getBackingBlob \ node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js
Affected versions
| Package | Affected range | Fixed in |
|---|---|---|
| react-server-dom-webpack | 19.0.0-19.0.8, 19.1.0-19.1.9, 19.2.0-19.2.8, 19.3.0 | 19.0.9 / 19.1.10 / 19.2.9 / 19.3.1 |
| react-server-dom-parcel | same | same (though 19.0.9 was never actually published for this package on npm, use 19.1.10+) |
| react-server-dom-turbopack | same | same |
Most applications pull these packages in transitively through a framework like Next.js, which creates a common mistake: upgrading react/react-dom alone is not enough. Next.js vendors a compiled copy of the Flight runtime directly into the framework itself, so next must be upgraded to 16.4.1 (Active LTS) or 15.5.28 (Maintenance LTS) or later for the actual fixed code to take effect.
Three artifacts need to be checked, and they can disagree with each other:
npm ls react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopackgrep -E 'react-server-dom-(webpack|parcel|turbopack)' package-lock.jsongrep -c getBackingBlob node_modules/next/dist/compiled/react-server-dom-webpack/cjs/*.production.js
If upgrading is not immediately possible, interim mitigations include:
- Refactoring
use cachefunctions so they never return multiple typed arrays sharing one buffer. - Encoding binary return values as strings so they serialise as plain text chunks instead.
- Adding argument validation and authorisation checks to every
"use server"function, since this attack calls the action directly and bypasses any UI flow that might otherwise gate it.
From a detection standpoint, watch for unusually long base64 query parameters on GET requests to cached pages, decoded tails containing Flight row syntax such as "bound":"$@ or "then":"$h, and spikes of Connection closed. 500 errors on cached routes, which are a sign of failed offset guessing.
Variants to test
- Shared-buffer typed arrays in any
use cachereturn value. Look for cached functions that return more than one typed array, especially ones that could share an allocation. A positive result is a serialised stream where a binary row's declared length exceeds the bytes actually delivered before the next row header. - Node slab-backed small Buffers. Check whether ordinary small Buffer allocations in cached return values are already views over a shared slab. A positive result is the same header/body mismatch appearing without any explicit shared
ArrayBufferin application code. - GET-only Server Action invocation. Send a crafted
GET /?annotation=<base64>to a cached page and watch for the action being invoked without a POST body orNext-Actionheader. A positive result is the action's side effect appearing in server logs or responses. - Thenable pivot through cached values. Plant a row with a
thenproperty pointing at a server reference and see whether the runtime invokes it on unwrap. A positive result is the bound action firing with the supplied arguments. - Padding resynchronisation. Vary the filler bytes and the trailing tiny row to see where the parser resynchronises. A positive result is a stable offset at which the forged rows are parsed as rows rather than swallowed as payload.
- Bundle grep for the patch marker. Run the
getBackingBlobgrep against compiled bundles innode_modules. A positive result for the fix is a non-zero count; a zero count on a build claiming to be patched is worth investigating.
What happened, in plain words
A website built with React and Next.js can be made to run commands on its own server by a stranger who has not logged in. The stranger sends an ordinary web request, the kind your browser makes when you open a page, and the server ends up executing something the stranger chose.
The flaw is not in the part of React that draws buttons and text. It is in the plumbing that carries data between the server and the browser, a format called Flight. Flight sends its data as a numbered list of rows, and each row says how long it is. The bug lets an attacker make one row claim a length it does not deliver, so the bytes that follow get read as if they were part of that row. Those bytes can be shaped to look like a different kind of row. When the server later reads back its own cached data, it calls a Server Action the attacker chose.
React's own security notice calls the trigger condition "extremely rare cases, responses that transport multiple typed arrays and an attacker-controlled value". In practice, the way Node.js (the program that runs JavaScript on the server) hands out small blocks of memory makes the condition more common than that wording suggests.

Some words you will need first
Before the details, a handful of everyday comparisons.
- Server and browser. The browser is the program on your computer showing the page. The server is a computer elsewhere that holds the data and does the work. When you open a page, your browser asks the server and the server answers.
- Request and response. A request is the message your browser sends ("give me this page"). A response is the message the server sends back (the page, or data).
- API. An API is a fixed menu of requests a program accepts, like a restaurant menu: you can order what is listed, in the way it is listed. Server Actions, below, are one such menu item in Next.js.
- React and Next.js. React is a toolkit for building web pages out of reusable pieces called components. Next.js is a framework built on React that adds the server side: it decides what runs on the server and what runs in the browser.
- React Server Components (RSC). Components that run on the server and send their result to the browser, rather than running in the browser.
- Flight. The format RSC uses to send that result. Think of it as a very capable delivery note: it can carry not just text and numbers but also promises ("a value will arrive later"), references to code modules, and raw binary data.
- Serialise and deserialise. To serialise is to turn a live thing in memory into a flat stream of bytes that can be stored or sent. To deserialise is to turn that stream back into a live thing. Like packing furniture into boxes and unpacking it at the other end.
- Typed array. A block of memory holding numbers of one fixed type, for example raw bytes. It is the usual way programs handle binary data such as images.
- ArrayBuffer. The underlying block of memory that a typed array looks at. Several typed arrays can look at different slices of the same ArrayBuffer, like several people reading different pages of the same book.
- Detach. When an ArrayBuffer is handed over to something else (for example sent through a stream), it can be detached: the memory is taken away and any typed array still pointing at it becomes empty. The book has left the room.
- Remote code execution (RCE). The attacker gets their own instructions run on someone else's server. The worst class of web bug, because from there the attacker can often do anything the server can.
- Unauthenticated. Without logging in. The attacker needs no account, no password, no session.
- Cache. A store of answers kept so the server does not have to recompute them. Like keeping yesterday's soup in the fridge instead of cooking again.
- Server Action. A function that lives on the server but can be called from the page. Next.js gives each one an ID so the browser can refer to it.
- WAF. Web Application Firewall: a filter placed in front of a site that inspects incoming requests and blocks suspicious ones.
- Proof of concept (PoC). A small program that demonstrates a bug really works, so others can check it.
1. How the Flight protocol works
RSC does not build the whole screen and send it in one piece. It streams the result as a sequence of rows. That stream can carry far more than plain data: promises, module references, Server Function references, Blobs (chunks of binary data) and typed arrays, all as live JavaScript concepts. That richness is the whole point of the design, and it is also where the bug lives.
Rows come in a few flavours:
1:I["victim-module",[],"*"]2:o4,ABCD0:{"msg":"hello","mod":"$1","ta":"$2"}
Line by line, in plain words:
1:I["victim-module",[],"*"]is a module reference row. The1:is the row's number. TheIsays "this row is a reference to a code module". The rest names the module and its arguments. When the browser-side code meets this row, it asks the bundler (the tool that packages code for the browser) to fetch that module, and the module runs. In a webpack build this ends in__webpack_require__(id), and that module runs.2:o4,ABCDis a binary row. Row number 2. Theois the type tag, meaning Uint8Array (a typed array of bytes). The4is the length written in hexadecimal, so four bytes.ABCDis the payload. The parser consumes exactly that many bytes as data, no questions asked. There is no delimiter such as a newline: the declared length is the boundary.0:{"msg":"hello","mod":"$1","ta":"$2"}is a text row. Row number 0, newline-terminated JSON (a text format for structured data). The strings$1and$2are pointers to other rows, here rows 1 and 2.
The critical point: module reference rows get executed, while binary rows get consumed as inert data. If the boundary between the two ever slips, bytes that were supposed to be harmless data can masquerade as an executable row instead.
Next.js 16's Cache Components feature adds a new trust boundary on top of this. A function marked "use cache" has its return value serialised through this same Flight format, stored in a cache entry, and later deserialised back inside the Node.js server process on subsequent requests. The server is parsing something it wrote itself, except part of that data came from the requester. That is the dangerous combination: a parser reading a stream it believes it produced.
2. Root cause: a header that promises bytes that no longer exist
The mechanism sits where two ideas meet: ArrayBuffer detach semantics and the Web Streams API (the browser and Node standard for handling streams of data).
A single ArrayBuffer can back multiple typed-array views. But a byte stream transfers, and thereby detaches, the entire ArrayBuffer of every chunk it receives. The patch commit's own comment spells this rule out explicitly.
The vulnerable serialisation code looked roughly like this:
function typedArrayToBinaryChunk(content) { return new Uint8Array(content.buffer, content.byteOffset, content.byteLength); }
What this does, piece by piece:
function typedArrayToBinaryChunk(content)declares a helper that turns a typed array into a binary chunk for the stream.new Uint8Array(content.buffer, content.byteOffset, content.byteLength)builds a new view that starts at the original array's offset and is as long as the original, but points atcontent.buffer, the original memory, with no copy.returnhands that view back to be written to the destination.
Any typed array larger than 2048 bytes (VIEW_SIZE) gets wrapped this way, with no copy, and written straight out. The trouble starts when two large views share one buffer:
Example: an 8192-byte ArrayBuffer shared by two 4096-byte viewsview A (offset 0–4095) → write(A) → entire buffer is detachedview B (offset 4096–8191) → B.byteLength is now 0 (buffer is empty)
Reading that diagram in order:
- One 8192-byte block of memory is shared by two views of 4096 bytes each.
- View A covers the first half. Writing it out hands the whole 8192-byte buffer to the stream, and the buffer is detached.
- View B covers the second half. Because the buffer is gone, B's
byteLengthis now 0. It is an empty view over memory that no longer belongs to it.
Instrumenting the write path during serialisation confirms it:
19.2.8 (vulnerable): write: byteLength=4096 bufferByteLength=8192 ← live shared buffer19.2.9 (fixed): write: byteLength=4096 bufferByteLength=4096 ← exact-size copy
In the vulnerable version 19.2.8, the view being written is 4096 bytes long and the buffer behind it is still the full 8192 bytes, so it is a live view over shared memory. In the fixed version 19.2.9, the buffer behind the view is exactly 4096 bytes, because the fix made a copy. The numbers show the difference: a live shared buffer before the fix, an exact-size copy after it.
By the time view B is processed, the serialiser has already written its framing header. It already promised "4096 bytes follow", and then, because the buffer was detached, it actually delivers a 0-byte payload. Inside writeChunk, a silent guard made this worse:
// vulnerable writeChunk skip logicif (chunk.byteLength === 0) return; // silently skipped — no error, no log
- The comment says this is the skip logic in the vulnerable
writeChunkfunction. if (chunk.byteLength === 0) return;means: if the chunk is empty, stop and write nothing. No error, no log.
The header promises 4096 bytes. The body delivers zero. That mismatch gets silently baked into the stream. Nobody is told.
A Node.js-specific wrinkle widens the exposure. Node serves any Buffer allocation smaller than Buffer.poolSize >>> 1 (half of the default 8 KiB) from an internal slab that is shared across multiple unrelated Buffers. In other words, even without an application explicitly writing new Uint8Array(sharedBuffer, ...), an ordinary small Buffer allocation is already structurally a view over a shared buffer. React's advisory calls this "extremely rare", but the actual exposure surface is likely broader than that phrasing implies.
3. How the parser ends up trusting the wrong bytes
The Flight client parser is a small state machine: a program that moves through a fixed set of states. It reads the row id up to a colon, reads a tag byte, then either scans to a newline or consumes an exact byte count. The fatal detail is this: the parser only trusts the length declared in the header. Whatever follows the colon, it will blindly consume that many bytes as data.
Here is the shape of a crafted stream:
2:o1000,<4096 bytes arrive>3:o1000, ← STARVED: 4096 promised, 0 delivered4:{"more":"rows continue"}\n ← entirely swallowed as row 3's payload5:o2000,<8192 bytes of attacker content> ^ parser resynchronizes inside this payload
Walking through it:
- Row 2 is a normal binary row of 4096 bytes.
- Row 3 announces a binary row of 4096 bytes, but zero bytes follow. It is starved: the header promised, the body did not arrive.
- Row 4 is a normal text row, but because row 3 is still waiting for its 4096 bytes, row 4's text is swallowed as if it were row 3's payload.
- Row 5 is a binary row of 8192 bytes of attacker content, and the parser resynchronises inside that payload, meaning it starts reading rows again from a point the attacker controls.
Three details make this chain work.
- The starved row itself does not block the tree; the swallowed row does. Row 3 resolves as a Uint8Array over the swallowed bytes: wrong, but valid. Row 4, whose header was itself eaten, never resolves, and anything referencing it just hangs. That is the opening.
- Padding is part of the exploit. Filler bytes such as
0x43(the characterC) also happen to be valid hex digits for a row id. If the padding lands wrong, it glues itself onto the next row id and corrupts parsing from the root. The attacker therefore ends the crafted blob with a tiny, valid row such as5:0\n, making the parser resynchronise at exactly the next legitimate byte. - Module chunks initialise lazily. A module reference row only executes once something consumes that chunk, so the planted row has to be reachable from something the application actually reads. Root references are the natural vehicle. Row ids are assigned sequentially within a single render, which made them predictable in testing; cross-request predictability was not verified.
4. The three-stage exploit chain, from the public PoC

The public proof of concept is briskets/CVE-2026-126187-poc, a dependency-free Python 3.8+ script. "Dependency-free" means it needs nothing installed beyond Python itself, so anyone can run it. It reproduces the full chain against a lab running Next.js 16.4.0, React 19.3.0 and Node 22.
4.1 Harvesting a target Server Action
Next.js compiles each Server Action to a hex ID that ships straight into the public client bundle, because the browser needs it to reference the action. The ID ships in the public client bundle, because the browser needs it to reference the action. The problem is that knowing the name is enough to order it.
4.2 Solving the byte-alignment problem
Where the forged rows need to land depends on how many bytes get swallowed (the over-read size), but that calculation is circular: the amount swallowed depends on where the forged rows are, and the position depends on the amount swallowed. For the lab's layout (chunk id 4, an 8192-byte over-read, an 8-byte header), the forged rows land exactly at offset 8184. An offset is simply a position counted in bytes from the start of the data.
4.3 Using a thenable to trigger automatic execution
The payload planted at that exact offset is three Flight rows:
6:["id; uname -a"]5:{"id":"<discovered_action_hex_id>","bound":"$@6"}4:{"then":"$h5"}
Line by line:
- Row 6,
["id; uname -a"], is the argument array the attacker wants to pass.uname -ais a standard command that prints information about the machine. - Row 5,
{"id":"<discovered_action_hex_id>","bound":"$@6"}, is Server Reference metadata.idis a genuine, registered Server Action ID, the one harvested in step 1.boundpre-binds the arguments from row 6, meaning the arguments are attached in advance. - Row 4,
{"then":"$h5"}, overwrites the attacker-influenced cached chunk with an object carrying athenproperty. The$htag points at the server reference in row 5.
The trigger is JavaScript's own specification. Under ECMA-262's PromiseResolveThenableJob, any object with a callable then property is treated as a thenable, and awaiting or resolving it auto-invokes then(resolve, reject). In everyday terms: JavaScript has a rule that says "if a value has a then method, call it when you need the value". The attacker supplies such a value, and the method it points at is the server function. The moment the runtime unwraps the cached value, the bound Server Action, arguments and all, gets called automatically.
This chain never walks a prototype chain (the inheritance links between JavaScript objects) and never touches the Function constructor (a way to build code from text). It simply uses the protocol's own reference-resolution machinery, correctly, to call a legitimately registered server function. That is exactly why hardening property lookups alone would not have stopped it: nothing improper was looked up.
Two details make this worse in the real world:
- The entire attack rides a plain
GET /?annotation=<base64>request. No POST body, noNext-Actionheader. A GET is the request your browser makes when you open a page; a POST is the one used to submit a form. Any WAF rule or middleware that only inspects POST traffic for Server Action calls never sees this. - The blast radius is whatever the targeted Server Action does with its arguments. The lab demo pipes the argument into
/bin/sh(the system shell, which runs commands), but a real application's action might write to a database, touch the filesystem, or call an internal service.
5. How the patch closed the hole
The fix shipped as PRs #37842 to #37846 ("[Flight] Improve transport protocol"). Rather than patching a single offset calculation, Rather than patching a single offset calculation, it adds defences at multiple independent layers.
Serialisation (write) side
function typedArrayToBinaryChunk(content) { if (content.byteLength > VIEW_SIZE && !spansEntireBuffer(content)) { return content.slice(); } }
- The function still takes a typed array.
if (content.byteLength > VIEW_SIZE && !spansEntireBuffer(content))checks two things: the array is larger than the 2048-byte threshold, and it does not cover its whole buffer.return content.slice();then makes a copy instead of a view. A copy cannot be detached by someone else's write, so the length promised in the header will match the bytes delivered.
And the silent skip is gone:
if (chunk.byteLength === 0 && isDetached(chunk.buffer)) { throw new Error( "Cannot transport a detached buffer. This usually happens when " + "trying to transport multiple buffer-spanning views on the same " + "underlying buffer. Either reuse the exact same view by identity " + "or copy the underlying buffer manually via view.slice()." ); }
if (chunk.byteLength === 0 && isDetached(chunk.buffer))detects exactly the dangerous case: an empty chunk whose buffer has been detached.throw new Error(...)stops the operation loudly instead of writing a broken header. The message explains the cause and the two ways to avoid it: reuse the same view, or copy the buffer withview.slice().
Deserialisation (read) side
ReactFlightClient.jsintroduces a module-privateRESPONSE_SYMBOL, moving the parser's internal state behind a symbol that is unreachable through ordinary property access. A symbol is a kind of key that other code cannot guess or collide with.- A new
ReactFlightReplyBackingFormData.jsreplaces raw FormData lookups with an indexed backing store that separates key spaces by kind: entries prefixed_are referenced FormData entries,Smarks stream/async-iterable chunks, everything else is a one-shot chunk. A chunk's kind is now determined by where it is stored, not by a key name the attacker chose. createModelnow returnsnullwhenever athenproperty holds a function, shutting down the thenable pivot at parse time even if a forged row manages to land again.loadServerReferencerejects anymetaData.idthat is not a string before it ever reachesresolveServerReferenceorrequireModule.
The fastest way to confirm a build is patched is to grep the compiled bundle for a new helper:
grep -c getBackingBlob \ node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js
grepis a command-line tool that searches text for a pattern.-casks it to print a count of matching lines rather than the lines themselves.getBackingBlobis the name of the new helper introduced by the fix.- The long path points at the compiled copy of the Flight runtime that Next.js ships inside
node_modules, the folder where installed packages live.
The original calls this grep the fastest way to confirm a build is patched.
Affected versions
| Package | Affected range | Fixed in |
|---|---|---|
| react-server-dom-webpack | 19.0.0-19.0.8, 19.1.0-19.1.9, 19.2.0-19.2.8, 19.3.0 | 19.0.9 / 19.1.10 / 19.2.9 / 19.3.1 |
| react-server-dom-parcel | same | same (though 19.0.9 was never actually published for this package on npm, use 19.1.10+) |
| react-server-dom-turbopack | same | same |
Most applications pull these packages in transitively through a framework like Next.js, which creates a common mistake. "Transitively" means you did not install them yourself; something you did install brought them along.
Upgrading react/react-dom alone is not enough. Next.js vendors a compiled copy of the Flight runtime directly into the framework itself, so next must be upgraded to 16.4.1 (Active LTS) or 15.5.28 (Maintenance LTS) or later for the actual fixed code to take effect. LTS means Long Term Support: a release line that keeps receiving fixes.
Three artifacts need to be checked, and they can disagree with each other:
npm ls react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopackgrep -E 'react-server-dom-(webpack|parcel|turbopack)' package-lock.jsongrep -c getBackingBlob node_modules/next/dist/compiled/react-server-dom-webpack/cjs/*.production.js
npm ls ...lists which versions of those three packages are actually installed, including ones pulled in indirectly.grep -E 'react-server-dom-(webpack|parcel|turbopack)' package-lock.jsonsearches the lockfile, the file that records exactly which versions were installed, for any mention of the three packages.-Eallows the pattern to use alternatives.grep -c getBackingBlob ...checks the compiled Next.js runtime for the patch marker, as above.
The trigger condition requires the App Router with Cache Components, where a use cache function returning multiple typed arrays sits on a page that can resolve a Server Action. If upgrading is not immediately possible, interim mitigations include:
- Refactoring
use cachefunctions so they never return multiple typed arrays sharing one buffer. - Encoding binary return values as strings so they serialise as plain text chunks instead.
- Adding argument validation and authorisation checks to every
"use server"function, since this attack calls the action directly and bypasses any UI flow that might otherwise gate it.
From a detection standpoint, watch for unusually long base64 query parameters on GET requests to cached pages, decoded tails containing Flight row syntax such as "bound":"$@ or "then":"$h, and spikes of Connection closed. 500 errors on cached routes, which are a sign of failed offset guessing. Base64 is a way of writing arbitrary bytes using only ordinary letters and digits, so binary payloads can travel inside a URL.
Variants to test
If you want to check your own setup, these are the angles the write-up suggests.
- Shared-buffer typed arrays in any
use cachereturn value. Look for cached functions that return more than one typed array, especially ones that could share an allocation. A positive result is a serialised stream where a binary row's declared length exceeds the bytes actually delivered before the next row header. - Node slab-backed small Buffers. Check whether ordinary small Buffer allocations in cached return values are already views over a shared slab. A positive result is the same header/body mismatch appearing without any explicit shared ArrayBuffer in application code.
- GET-only Server Action invocation. Send a crafted
GET /?annotation=<base64>to a cached page and watch for the action being invoked without a POST body orNext-Actionheader. A positive result is the action's side effect appearing in server logs or responses. - Thenable pivot through cached values. Plant a row with a
thenproperty pointing at a server reference and see whether the runtime invokes it on unwrap. A positive result is the bound action firing with the supplied arguments. - Padding resynchronisation. Vary the filler bytes and the trailing tiny row to see where the parser resynchronises. A positive result is a stable offset at which the forged rows are parsed as rows rather than swallowed as payload.
- Bundle grep for the patch marker. Run the
getBackingBlobgrep against compiled bundles innode_modules. A positive result for the fix is a non-zero count; a zero count on a build claiming to be patched is worth investigating.
Glossary
- API: a fixed menu of requests a program accepts, with rules about what you may ask for and how.
- ArrayBuffer: a block of memory that typed arrays can look at, possibly several at once.
- Base64: a way of writing arbitrary bytes using only ordinary letters and digits, so binary data can travel inside text such as a URL.
- Binary row: a Flight row carrying raw bytes, whose length is declared in the header.
- Blob: a chunk of binary data treated as a single value.
- Buffer: Node.js's object for a block of raw bytes.
- Bundler: a tool that packages code into files a browser can load.
- Cache Components: a Next.js 16 feature where functions marked
"use cache"have their results stored and reused. - Client bundle: the JavaScript files sent to the browser.
- Detach: taking an ArrayBuffer's memory away from the views that pointed at it, leaving them empty.
- Deserialise: turn a flat stream of bytes back into live values in memory.
- Flight: the wire format React Server Components use to stream results as rows.
- GET: the request type a browser uses to fetch a page or resource.
- Header: the part of a row that states its number and, for binary rows, its length.
- Hex / hexadecimal: a way of writing numbers using digits 0 to 9 and letters A to F.
- JSON: a text format for structured data, built from objects, arrays, strings and numbers.
- LTS (Long Term Support): a release line that keeps receiving fixes for a long period.
- Middleware: code that sits in front of an application and inspects requests before they reach it.
- Module reference row: a Flight row that tells the client to load and run a code module.
- Node.js: the program that runs JavaScript on a server.
- npm: the package manager for JavaScript, which installs and lists packages.
- Offset: a position counted in bytes from the start of some data.
- POST: the request type used to submit data, for example a form.
- Proof of concept (PoC): a small program demonstrating that a bug really works.
- Promise: a JavaScript value representing a result that will arrive later.
- Prototype chain: the inheritance links between JavaScript objects.
- Remote code execution (RCE): an attacker getting their own instructions run on someone else's server.
- Request / response: the message a browser sends and the message a server sends back.
- React: a toolkit for building web pages out of reusable components.
- React Server Components (RSC): components that run on the server and send their result to the browser.
- Serialise: turn live values in memory into a flat stream of bytes.
- Server Action: a function that lives on the server and can be called from the page, identified by an ID.
- Slab: a shared block of memory from which Node.js hands out small Buffers.
- State machine: a program that moves through a fixed set of states, one step at a time.
- Stream: data delivered piece by piece rather than all at once.
- Symbol: a kind of key in JavaScript that other code cannot guess or collide with.
- Text row: a Flight row carrying newline-terminated JSON.
- Thenable: any object with a callable
thenproperty, which JavaScript will call when it needs the value. - Transitive dependency: a package you did not install directly but that came in with something you did install.
- Typed array: a block of memory holding numbers of one fixed type, such as raw bytes.
- Unauthenticated: without logging in; no account or session needed.
- Uint8Array: a typed array of unsigned 8-bit bytes.
- WAF (Web Application Firewall): a filter in front of a site that inspects and blocks suspicious requests.
- Web Streams API: the standard for handling streams of data in browsers and Node.js.
- Webpack: a bundler commonly used with React.