# CVE-2026-126187: React Server Components Flaw Lets Attackers Execute Code Through Smuggled Flight Rows

React Server Components Flight writer silently drops large typed-array views, starving a binary row header so the client parser resyncs inside attacker bytes and executes a smuggled module row.

- Payout: Research
- Severity: critical
- Program: React Server Components
- Write-up by: StepSecurity
- Disclosed: 2026-11-12
- CVE: CVE-2026-126187
- Write-up quality: 8/10
- Original: https://www.stepsecurity.io/blog/cve-2026-126187-react-flight-rce
- Library page: https://bugbountylibrary.com/r/blog%3Astepsecurity-io-blog-cve-2026-126187-react-flight-rce
- Tags: area:oss domain:oss domain:web impact:rce kind:research platform:threat-intel sev:critical tech:nodejs tech:react technique:incomplete-fix technique:source-review vuln:deserialization vuln:rce

**Target:** RSC Flight protocol writer/parser in react-server-dom-webpack/parcel/turbopack
**Root cause:** The Flight writer's large-chunk path skips zero-length chunks (guard `0 !== chunk.byteLength`), queuing header and view separately so the view is dropped while the header stays on the wire, promising bytes that never arrive. The client parser consumes the next stream bytes to satisfy the starved header and resynchronizes at an unaligned offset, letting attacker-controlled payload bytes be parsed as protocol rows.
**Steps:**
1. Render an RSC response containing multiple typed-array views over one shared ArrayBuffer larger than 2048 bytes, with attacker-influenced bytes inside one view.
2. A downstream consumer (fetch body, BYOB reader, edge transfer boundary) takes ownership and detaches the backing store, so the writer's view becomes zero-length.
3. Writer skips the zero-length view but keeps the header, emitting a starved binary row like `3:o1000,` with 4096 bytes promised and none following.
4. Parser consumes following rows' headers/payloads as row 3 data, then resynchronizes inside attacker-controlled bytes.
5. Attacker pads with valid hex row-id chars (e.g. 0x43 'C') and ends with a tiny valid row like `5:0\n` to force exact resync.
6. Plant `3:I["attacker-module",[],"*"]\n` at the resync offset; the smuggled module row claims the swallowed row's id and executes when the application consumes it.
**How found:** Reconstructed from the five backport PRs (#37842-#37846) and diffed npm builds 19.2.8 vs 19.2.9; instrumenting the writer boundary showed 19.2.8 handing out a live 8192-byte shared buffer view while 19.2.9 copies to exact-size 4096. Noticed the writer's `0 !== chunk.byteLength` guard silently drops zero-length chunks while the header remains, then traced the parser state machine to see it consumes bytes to satisfy a starved header and resyncs unaligned.
**Exploitation:** Attacker needs one response transporting multiple views over one shared ArrayBuffer plus a consumer that transfers/detaches backing stores. The starved header causes the parser to swallow subsequent rows; a planted module row at the resync offset is resolved via __webpack_require__ and executes arbitrary code from the app's own bundle when the application reads the swallowed row's reference.
**Escalation:** Smuggled module row claims the id of the swallowed row so the application consumes attacker code where data was expected; module chunks initialize lazily on consumption, so the planted row must be reachable from a row the app reads (root references are the natural vehicle).
**Insight:** In length-delimited streaming protocols, look for writer paths that queue header and payload as separate entries with a zero-length skip: the header can survive while the payload is dropped, and any parser that trusts the declared length will consume subsequent frames as data. Also note hex row-id alphabets overlap ASCII padding, so attacker bytes can be crafted to force exact resync.

## Proof of concept (copied exactly from the original report)

**Corrupted Flight stream with starved row and smuggled module**

```
2:o1000,<4096 bytes arrived>
3:o1000, <- STARVED: 4096 promised, none arrive
4:{"more":"rows continue"}\n <- swallowed as row 3 payload
5:o2000,<8192 bytes of attacker content>
```

**Smuggled module row planted at resync offset**

```
The smuggled row is one line, 3:I["attacker-module",[],"*"]\n, planted at the exact resync offset inside attacker-controlled bytes.
```

**End-to-end reproduction output executing victim module**

```
=== vulnerable writer 19.2.8, shared-buffer detach ===
[*] writer surfaced NO error (silent tolerance)
[*] wire captured: 12400 bytes
[!!] END-TO-END: victim module executed from the real rendered stream
```

