Skip to content

Commit 2785dc5

Browse files
authored
Merge pull request #1653 from HackTricks-wiki/update_CVE-2025-55182___CVE-2025-66478_React2Shell___All__20251209_020825
CVE-2025-55182 & CVE-2025-66478 React2Shell – All You Need t...
2 parents c9446ff + 5b2c662 commit 2785dc5

File tree

1 file changed

+35
-0
lines changed
  • src/network-services-pentesting/pentesting-web

1 file changed

+35
-0
lines changed

src/network-services-pentesting/pentesting-web/nextjs.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,10 +1362,45 @@ Next.js App Router deployments that expose Server Actions on `react-server-dom-w
13621362
}
13631363
```
13641364

1365+
#### Mapping React Server Function exposure
1366+
1367+
React Server Functions (RSF) are any functions that include the `'use server';` directive. Every form action, mutation, or fetch helper bound to one of those functions becomes an RSC Flight endpoint that will happily deserialize attacker-supplied payloads. Useful recon steps derived from React2Shell assessments:
1368+
1369+
- **Static inventory:** look for the directive to understand how many RSFs are being automatically exposed by the framework.
1370+
1371+
```bash
1372+
rg -n "'use server';" -g"*.{js,ts,jsx,tsx}" app/
1373+
```
1374+
1375+
- **App Router defaults:** `create-next-app` enables the App Router + `app/` directory by default, which silently turns every route into an RSC-capable endpoint. App Router assets such as `/_next/static/chunks/app/` or responses that stream Flight chunks over `text/x-component` are strong Internet-facing fingerprints.
1376+
- **Implicitly vulnerable RSC deployments:** React’s own advisory notes that apps shipping the RSC runtime can be exploitable **even without explicit RSFs**, so treat any build using `react-server-dom-*` 19.0.0–19.2.0 as suspect.
1377+
- **Other frameworks bundling RSC:** Vite RSC, Parcel RSC, React Router RSC preview, RedwoodSDK, Waku, etc. reuse the same serializer and inherit the identical remote attack surface until they embed patched React builds.
1378+
1379+
#### Version coverage (React2Shell)
1380+
1381+
- `react-server-dom-webpack`, `react-server-dom-parcel`, `react-server-dom-turbopack`: **vulnerable** in 19.0.0, 19.1.0–19.1.1 and 19.2.0; **patched** in 19.0.1, 19.1.2 and 19.2.1 respectively.
1382+
- **Next.js stable:** App Router releases 15.0.0–16.0.6 embed the vulnerable RSC stack. Patch trains 15.0.5 / 15.1.9 / 15.2.6 / 15.3.6 / 15.4.8 / 15.5.7 / 16.0.7 include fixed deps, so any build below those versions is high-value.
1383+
- **Next.js canary:** `14.3.0-canary.77+` also ships the buggy runtime and currently lacks patched canary drops, making those fingerprints strong exploitation candidates.
1384+
1385+
#### Remote detection oracle
1386+
1387+
Assetnote’s [`react2shell-scanner`](https://github.com/assetnote/react2shell-scanner) sends a crafted multipart Flight request to candidate paths and watches server-side behavior:
1388+
1389+
- **Default mode** executes a deterministic RCE payload (math operation reflected via `X-Action-Redirect`) proving code execution.
1390+
- **`--safe-check` mode** purposefully malforms the Flight message so patched servers return `200/400`, while vulnerable targets emit `HTTP/500` responses containing the `E{"digest"` substring inside the body. That `(500 + digest)` pair is currently the most reliable remote oracle published by defenders.
1391+
- Built-in `--waf-bypass`, `--vercel-waf-bypass`, and `--windows` switches adjust payload layout, prepend junk, or swap OS commands so you can probe real Internet assets.
1392+
1393+
```bash
1394+
python3 scanner.py -u https://target.tld --path /app/api/submit --safe-check
1395+
python3 scanner.py -l hosts.txt -t 20 --waf-bypass -o vulnerable.json
1396+
```
1397+
13651398
## References
13661399

13671400
- [Pentesting Next.js Server Actions — A Burp Extension for Hash-to-Function Mapping](https://www.adversis.io/blogs/pentesting-next-js-server-actions)
13681401
- [NextjsServerActionAnalyzer (Burp extension)](https://github.com/Adversis/NextjsServerActionAnalyzer)
13691402
- [CVE-2025-55182 React Server Components Remote Code Execution Exploit Tool](https://github.com/Spritualkb/CVE-2025-55182-exp)
1403+
- [CVE-2025-55182 & CVE-2025-66478 React2Shell – All You Need to Know](https://jfrog.com/blog/2025-55182-and-2025-66478-react2shell-all-you-need-to-know/)
1404+
- [assetnote/react2shell-scanner](https://github.com/assetnote/react2shell-scanner)
13701405

13711406
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)