CVE-2026-126187 is a deserialization-of-untrusted-data (CWE-502) issue in the React Server Components "Flight" transport protocol, fixed by the "[Flight] Improve transport protocol" patch set (react/react#37842/#37843/#37844/#37845/#37846). The advisory states the exploit requires a response that transports multiple typed arrays plus an attacker-controlled value, and that this can lead to unauthenticated remote code execution.
Root cause and exploit chain:
-
Typed-array transport (server render side): typedArrayToBinaryChunk in ReactServerStreamConfig{Edge,Node,Browser}.js converted any typed array into a Uint8Array view over the entire backing ArrayBuffer and handed it to the destination byte stream. A byte stream transfers (detaches) the whole ArrayBuffer. When a response carried several typed arrays that are views into one shared buffer, transferring the first view detached the buffer that the remaining views still referenced, so subsequent chunks read as empty / aliased memory. writeChunk blindly returned for such zero-length (detached) chunks with no check — its new code literally warns "This could be a security issue if the buffer was not actually empty." The patch makes typedArrayToBinaryChunk slice any view that does not span its whole buffer (or whose buffer is resizable) and makes writeChunk throw on a detached buffer.
-
Deserialization of the untrusted reply (server acting as client): parseModelString, parseTypedArray, resolveStream and the ReactFlightReplyBackingFormData lookups in ReactFlightReplyServer.js consumed attacker-controlled FormData entries. The old code matched backing entries by position (peekBackingEntry/getAllBackingEntries/consumeBackingEntry) and used one shared namespace for stream chunks and one-shot chunks, so a crafted payload could pick/consume entries belonging to a different reference and interleave stream chunks with one-shot model chunks. The patch introduces explicit namespaces ('_' for referenced FormData, 'S' for stream chunks) and dedicated lookups (getBackingString/getBackingBlob/getStreamChunks/consumeBackingEntries).
-
RCE gadget (client-side resolver): loadServerReference in ReactFlightClient.js resolved a Server Reference from the payload and (a) wrote it to a property named then (turning the deserialized object into an attacker-controlled thenable) and (b) called Promise.resolve(metaData.bound), i.e. invoked the .then method of a foreign, attacker-controlled thenable, and used metaData.id without validating it is a string. The patch adds key === 'then' and typeof id !== 'string' guards and only awaits bound when it is one of React's own ReactPromise chunks ("Anything else could be a foreign thenable whose then we must not call"). This is the point where an attacker-chosen function gets invoked. initializeModelChunk additionally took the Flight Response straight out of chunk.reason (now only trusted when wrapped in the private RESPONSE_SYMBOL), so a crafted chunk could supply a forged response/module map used to load and invoke arbitrary modules.
An engineer running an affected version should look for these symbols in CPU profiles / stack traces during exploitation: the transport writers typedArrayToBinaryChunk and writeChunk; the server reply deserializer parseModelString, parseTypedArray, resolveStream (and the backing-store helpers); and the client resolver loadServerReference / initializeModelChunk. Fixes were back-ported to 19.0.9, 19.1.10, 19.2.9 and 19.3.1 for react-server-dom-webpack / -parcel / -turbopack.